SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
722 stars 112 forks source link

[Bug] Regression in 0.1.25 release #594

Closed ejpenney closed 1 month ago

ejpenney commented 1 month ago

Describe the bug

Looks like the import for device_registry was removed from sensor.py but it is still used.

To Reproduce Steps to reproduce the behavior:

  1. Update to 0.1.25
  2. Restart
  3. Integration does not load
  4. Check Logs, see error

Expected behavior Integration loads

System configuration System: HASSIO HA Version: 2024.5.x WyzeApi Version: 0.1.25

home-assistant.log

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:748
integration: Sensor (documentation, issues)
First occurred: 11:41:08 AM (2 occurrences)
Last logged: 11:41:08 AM

Error adding entity None for domain sensor with platform wyzeapi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 748, in _async_add_entity
    if self.config_entry and (device_info := entity.device_info):
                                             ^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/wyzeapi/sensor.py", line 171, in device_info
    dr.CONNECTION_NETWORK_MAC,
    ^^
NameError: name 'dr' is not defined
brg468 commented 1 month ago

Hmm that shouldn't have happened, I must have missed it when addressing a merge conflict. I'll get a fix out soon.

SecKatie commented 1 month ago

This is fixed in the latest release 😃