bigbadblunt / homeassistant-lightwave2

Lightwave RF custom component for Home Assistant. Requires generation 2 ("Link Plus") hub, but will control both generation 1 ("Connect Series") and generation 2 ("Smart Series") devices.
41 stars 10 forks source link

Door sensor open/close state not hidden when hiding Homekit events #102

Open garysargentpersonal opened 1 year ago

garysargentpersonal commented 1 year ago

The LW931 door sensor open/close state is provided by Homekit, so I'd expect this sensor to be hidden when hiding things provided by Homekit (leaving just the battery diagnostic).

garysargentpersonal commented 1 year ago

This sensor is still shown even in the latest beta (3.5.17beta2).

I'm also now getting an error log at startup:

Logger: homeassistant.components.binary_sensor
Source: custom_components/lightwave2/binary_sensor.py:80
Integration: Binary Sensor (documentation, issues)
First occurred: 14:30:27 (2 occurrences)
Last logged: 14:30:27

Error adding entities for domain binary_sensor with platform lightwave2
Error while setting up lightwave2 platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 788, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/lightwave2/binary_sensor.py", line 80, in async_added_to_hass
    registry = er.async_get(self._hass)
AttributeError: 'LWRF2BinarySensor' object has no attribute '_hass'

Unrelated but I noticed this when deleting and re-adding the integration to check if that helped... when you add the integration you aren't presented with the config screen in the wizard, so have no opportunity to select "ignore homekit" or "use public api" when you setup the integration. Feels like you should get that choice when initially setting things up, not after.

bigbadblunt commented 1 year ago

Thanks, just pushed a new beta for you to test.

Agreed on the config options, will try to work out how that can be implemented.

bigbadblunt commented 1 year ago

Is this fixed now?

garysargentpersonal commented 1 year ago

The entity is still there, but is marked as "hidden" in its settings, which just hides it from the default dashboard.

The error mentioned above is also still appearing.

bigbadblunt commented 1 year ago

Literally the same error? Can you post a full log please?