Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while setting up nuki_ng platform for sensor #181

Open
Claudio1L opened this issue Jan 17, 2024 · 9 comments
Open

Error while setting up nuki_ng platform for sensor #181

Claudio1L opened this issue Jan 17, 2024 · 9 comments

Comments

@Claudio1L
Copy link

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

@kvj
Copy link
Owner

kvj commented Jan 17, 2024

Which HA version you're on?

@Claudio1L
Copy link
Author

immagine

@leppa
Copy link

leppa commented Jan 17, 2024

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

@Claudio1L
Copy link
Author

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

@CAVACO-PT
Copy link

CAVACO-PT commented Jan 18, 2024

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
Copy link
Owner

kvj commented Jan 18, 2024

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

@isibizi
Copy link

isibizi commented Jan 18, 2024

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

Solved the issue

inc-ali added a commit to inc-ali/hass_nuki_ng that referenced this issue Jan 18, 2024
@inc-ali
Copy link
Contributor

inc-ali commented Jan 20, 2024

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

@kvj please merge :)

kvj added a commit that referenced this issue Jan 20, 2024
fix: Set default value for None #181
@kvj
Copy link
Owner

kvj commented Jan 20, 2024

Updated to 0.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants