-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump roombapy to 1.6.12 #110762
Bump roombapy to 1.6.12 #110762
Conversation
Hey there @pschmitt, @cyr-ius, @shenxn, @Xitee1, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
mehhh ... |
Lovely. They either should make it work with Pydantic V1 and support v2 via shims. (Since I'm trying to get HA to migrate to V2 safely, I don't think it's a good idea to accept new dependencies with Pydantic V1 without support for working with v2 (using the included shims)). Or they should move away completely to another lib like mashumaro. I'll try to find some time to help with this since I'm also a Roomba user :) |
Well, in a new patch version it should work with Pydantic v1 and v2, added some tests for this. UPD: @mib1185 1.6.12 is already available :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing, can you take a look?
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
It's due to stricter invariants in roombapy now. I'd like to enforce strict typing in this integration soon. Here is a patch for - roomba = RoombaInfo(
- hostname="irobot-BLID",
- robot_name="robot_name",
- ip=MOCK_IP,
- mac="mac",
- firmware="firmware",
- sku="sku",
- capabilities="capabilities",
- )
+ roomba = RoombaInfo(
+ hostname="irobot-BLID",
+ robotname="robot_name",
+ ip="1.2.3.4",
+ mac="mac",
+ sw="firmware",
+ sku="sku",
+ cap={"capability": 1},
+ ) |
We can enable strict typing in a follow up, but this PR now breaks some tests, that should be fixed first. |
Also, please don't forget to add a py.typed file for enabling mypy to read types from the lib. https://peps.python.org/pep-0561/ |
Sure, I hope to finish polishing the library and integration for the next release. But this PR isn't mine, so I can only help with the patch. |
i'm not familiar with error
def _mocked_discovery(*_):
roomba_discovery = MagicMock()
roomba = RoombaInfo(
hostname="irobot-BLID",
robot_name="robot_name",
ip=MOCK_IP,
mac="mac",
firmware="firmware",
sku="sku",
capabilities={"cap1": 1},
)
class RoombaInfo(BaseModel):
hostname: str
firmware: str = Field(alias="sw")
ip: str
mac: str
robot_name: str = Field(alias="robotname")
sku: str
capabilities: Dict[str, int] = Field(alias="cap")
password: Optional[str] = None EDIT: when using the "alias" names for the properties, than it works def _mocked_discovery(*_):
roomba_discovery = MagicMock()
roomba = RoombaInfo(
hostname="irobot-BLID",
robotname="robot_name",
ip=MOCK_IP,
mac="mac",
sw="firmware",
sku="sku",
cap={"cap1": 1},
) that's weird 🤨 |
* bump roombapy to 1.6.11 * Apply suggestions from code review * "fix" tests (make them pydantic fiendly?) --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Proposed change
release-notes: https://github.com/pschmitt/roombapy/releases/tag/1.6.12
diff: pschmitt/roombapy@1.6.10...1.6.12
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: