Skip to content

Commit 0f70bf9

Browse files
authored
fix: Allow firmware version as an optional field (#670)
* fix: Allow firmware version as an optional field This field may not be returned by the API, in particular when the device is offline. ``` 2025-12-14 18:09:25.550 ERROR (MainThread) [roborock.data.containers] Failed to convert devices with value [{'duid': 'yyyyyy', 'name': 'S6 Pure', 'localKey': 'xxxxxx', 'productId': 'zzzzzz', 'activeTime': NNNNNNN, 'timeZoneId': 'Europe/Moscow', 'iconUrl': '', 'share': False, 'online': False, 'pv': '1.0', 'tuyaMigrated': False, 'extra': '{}', 'deviceStatus': {}, 'silentOtaSwitch': False, 'f': False}] to type list[roborock.data.containers.HomeDataDevice] Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/roborock/data/containers.py", line 122, in from_dict result[key] = RoborockBase._convert_to_class_obj(field_type, value) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/roborock/data/containers.py", line 73, in _convert_to_class_obj return [RoborockBase._convert_to_class_obj(sub_type, obj) for obj in value] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/roborock/data/containers.py", line 81, in _convert_to_class_obj return class_type.from_dict(value) ~~~~~~~~~~~~~~~~~~~~^^^^^^^ File "/usr/local/lib/python3.13/site-packages/roborock/data/containers.py", line 127, in from_dict return cls(**result) TypeError: HomeDataDevice.__init__() missing 1 required positional argument: 'fv' ``` * chore: add test for example offline device
1 parent 4b4e5aa commit 0f70bf9

File tree

3 files changed

+41
-11
lines changed

3 files changed

+41
-11
lines changed

roborock/data/containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ class HomeDataDevice(RoborockBase):
238238
duid: str
239239
name: str
240240
local_key: str
241-
fv: str
242241
product_id: str
242+
fv: str | None = None
243243
attribute: Any | None = None
244244
active_time: int | None = None
245245
runtime_env: Any | None = None

0 commit comments

Comments
 (0)