Skip to content

Commit 26b122d

Browse files
committed
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' ```
1 parent 11f362e commit 26b122d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

roborock/data/containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ class HomeDataDevice(RoborockBase):
234234
duid: str
235235
name: str
236236
local_key: str
237-
fv: str
238237
product_id: str
238+
fv: str | None = None
239239
attribute: Any | None = None
240240
active_time: int | None = None
241241
runtime_env: Any | None = None

0 commit comments

Comments
 (0)