sauresha icon indicating copy to clipboard operation
sauresha copied to clipboard

KeyError: True

Open and7ey opened this issue 1 month ago • 0 comments

В логе периодически появляется следующая ошибка:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:737
integration: Sensor (documentation, issues)
First occurred: 6:21:13 PM (1 occurrences)
Last logged: 6:21:13 PM

sauresha: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 737, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1318, in async_device_update
    await self.async_update()
  File "/config/custom_components/sauresha/entity.py", line 478, in async_update
    self._state = await self.async_fetch_state()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sauresha/entity.py", line 451, in async_fetch_state
    "hardware_name": self.controller.get_controller_name(
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        my_controller.hardware
        ^^^^^^^^^^^^^^^^^^^^^^
    ),
    ^
  File "/config/custom_components/sauresha/api.py", line 145, in get_controller_name
    return {
           ~
    ...<12 lines>...
        version_id == "9.1": "контроллер R8(после 2022)",
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    }[True]
    ~^^^^^^
KeyError: True

and7ey avatar Dec 29 '24 15:12 and7ey