hass_nuki_ng icon indicating copy to clipboard operation
hass_nuki_ng copied to clipboard

Error while setting up nuki_ng platform for sensor

Open Claudio1L opened this issue 1 year ago • 9 comments

after update to 0.5.1 started receiving the following errors: Was not present in 0.5.0

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:368 Integration: Sensor (documentation, issues) First occurred: 13:22:57 (1 occurrences) Last logged: 13:22:57 Error while setting up nuki_ng platform for sensor

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 368, in _async_setup_platform await asyncio.gather(*pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity original_icon=entity.icon, ^^^^^^^^^^^ File "/config/custom_components/nuki_ng/sensor.py", line 133, in icon state = self.get_state() ^^^^^^^^^^^^^^^^ File "/config/custom_components/nuki_ng/sensor.py", line 147, in get_state door_sensor_state = DoorSensorStates( ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 714, in call return cls.create( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 853, in create _, first_enum = cls.get_mixins(class_name, bases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 952, in get_mixins mcls.check_for_existing_members(class_name, bases) File "/usr/local/lib/python3.11/enum.py", line 936, in check_for_existing_members raise TypeError( TypeError: <enum 2> cannot extend <enum 'DoorSensorStates'>

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:507 Integration: Sensor (documentation, issues) First occurred: 13:22:57 (1 occurrences) Last logged: 13:22:57 Error adding entities for domain sensor with platform nuki_ng

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 672, in _async_add_entity original_icon=entity.icon, ^^^^^^^^^^^ File "/config/custom_components/nuki_ng/sensor.py", line 133, in icon state = self.get_state() ^^^^^^^^^^^^^^^^ File "/config/custom_components/nuki_ng/sensor.py", line 147, in get_state door_sensor_state = DoorSensorStates( ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 714, in call return cls.create( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 853, in create _, first_enum = cls.get_mixins(class_name, bases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 952, in get_mixins mcls.check_for_existing_members(class_name, bases) File "/usr/local/lib/python3.11/enum.py", line 936, in check_for_existing_members raise TypeError( TypeError: <enum 2> cannot extend <enum 'DoorSensorStates'>

immagine

immagine

Claudio1L avatar Jan 17 '24 12:01 Claudio1L

Which HA version you're on?

kvj avatar Jan 17 '24 12:01 kvj

immagine

Claudio1L avatar Jan 17 '24 13:01 Claudio1L

Same issue. If I revert this change (line 148 in sensor.py), the sensor works again.

leppa avatar Jan 17 '24 16:01 leppa

Thanks. After reverting line 148 in sensor.py start working also for me.

Claudio1L avatar Jan 17 '24 18:01 Claudio1L

Same issue

Nuki NG 0.51 or 0.50 - same problem

Nuki Firmaware - 2.15.3

Core 2024.1.3 Supervisor 2023.12.1 Operating System 11.4 Frontend 20240104.0

It stopped working after i updated to the lastest version of the nuki firmware

CAVACO-PT avatar Jan 18 '24 10:01 CAVACO-PT

Hi @inc-ali could you please take a look? I guess your PR is causing issues on some environments

kvj avatar Jan 18 '24 12:01 kvj

Same issue. If I revert this change (line 148 in sensor.py), the sensor works again.

Solved the issue

isibizi avatar Jan 18 '24 13:01 isibizi

Hi @inc-ali could you please take a look? I guess your PR is causing issues on some environments

@kvj please merge :)

inc-ali avatar Jan 20 '24 16:01 inc-ali

Updated to 0.5.2

kvj avatar Jan 20 '24 16:01 kvj