tschamm / boschshcpy

Bosch Smart Home Controller API Python Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'NORMAL' is not a valid CommunicationQualityService.State

beilm opened this issue · comments

While reloading my HomeAssistant instance I got an error:

ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform bosch_shc
Traceback (most recent call last):
[...]
File "/custom_components/bosch_shc/sensor.py", line 371, in native_value
return self._device.communicationquality.name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/boschshcpy/models_impl.py", line 172, in communicationquality
return self._communicationquality_service.value
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/boschshcpy/services_impl.py", line 769, in value
return self.State(self.state["quality"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 712, in __call__
return cls.__new__(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/enum.py", line 1128, in __new__
raise ve_exc
ValueError: 'NORMAL' is not a valid CommunicationQualityService.State

I tried to check current state in Postman for the device "PLUG_COMPACT" with the error:

{
    "@type": "DeviceServiceData",
    "id": "CommunicationQuality",
    "deviceId": "hdm:ZigBee:[...]",
    "state": {
        "@type": "communicationQualityState",
        "quality": "NORMAL"
    },
    "path": "/devices/hdm:ZigBee:[...]/services/CommunicationQuality"
}

Is it possible to add the state NORMAL?

Thanks for reporting. Fixed in 5fb7f10