kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
167 stars 32 forks source link

Error while setting up nuki_ng platform for sensor #181

Open Claudio1L opened 5 months ago

Claudio1L commented 5 months ago

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._getmixins(class_name, bases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 952, in _getmixins mcls._check_for_existingmembers(class_name, bases) File "/usr/local/lib/python3.11/enum.py", line 936, in _check_for_existingmembers 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._getmixins(class_name, bases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 952, in _getmixins mcls._check_for_existingmembers(class_name, bases) File "/usr/local/lib/python3.11/enum.py", line 936, in _check_for_existingmembers raise TypeError( TypeError: <enum 2> cannot extend <enum 'DoorSensorStates'>

immagine

immagine

kvj commented 5 months ago

Which HA version you're on?

Claudio1L commented 5 months ago

immagine

leppa commented 5 months ago

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

Claudio1L commented 5 months ago

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

CAVACO-PT commented 5 months ago

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

kvj commented 5 months ago

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

isibizi commented 5 months ago

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

Solved the issue

inc-ali commented 5 months ago

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

@kvj please merge :)

kvj commented 5 months ago

Updated to 0.5.2