Closed M4D1NG3R closed 2 years ago
The JSON returned by "Device/DeviceInfo" has a structure unexpected by the API:
{'device_info': {'device_category': '', 'manufacturer': 'DT', ...}}
Therefore, the formatting (DeviceInfo(**data)) returns 'none' for each attribute
with version 1.0.6 the error is not occurring This is currently also breaking the Home Assistant custom component
workaround for Home Assistant OS useres:
"requirements": [ "sagemcom_api===1.0.7" ],
"requirements": [],
If you run into any problem just comment.
Steps to reproduce the behavior:
using device_info = await client.get_device_info()
device_info = await client.get_device_info()
a workaround is to replace in client.py:
... try: data = await self.get_value_by_xpath("Device/DeviceInfo") except UnknownPathException: ...
with
... try: data = await self.get_value_by_xpath("Device/DeviceInfo") return DeviceInfo(**data.get("device_info")) except UnknownPathException: ...
[bug]
@iMicknl do you need anything else from my side?
Model information
Describe the bug
The JSON returned by "Device/DeviceInfo" has a structure unexpected by the API:
{'device_info': {'device_category': '', 'manufacturer': 'DT', ...}}
Therefore, the formatting (DeviceInfo(**data)) returns 'none' for each attribute
with version 1.0.6 the error is not occurring This is currently also breaking the Home Assistant custom component
workaround for Home Assistant OS useres:
"requirements": [ "sagemcom_api===1.0.7" ],
to"requirements": [],
If you run into any problem just comment.
To Reproduce
Steps to reproduce the behavior:
using
device_info = await client.get_device_info()
Screenshots
Additional context
a workaround is to replace in client.py:
with
[bug]