Commit 26b122d
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- roborock/data
- tests/devices/__snapshots__
2 files changed
+10
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | 237 | | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
0 commit comments