jaraco / jaraco.abode

MIT License
11 stars 9 forks source link

Better use of type hierarchy for Occupancy behaviors #30

Closed jaraco closed 1 month ago

jaraco commented 2 months ago

In #29, we learned that the special handling of type=Occupancy in the BinarySensor cannot be readily moved to the relevant subclass:

https://github.com/jaraco/jaraco.abode/blob/abb2c6a0028ac04cee3ca2c40bfb8186b972f9a3/jaraco/abode/devices/binary_sensor.py#L17-L18

It turns out that other specialized subclasses (Motion, Occupancy, sensor.Sensor) all rely on this behavior, and maybe only selectively (there may be cases where a Motion or Occupancy or sensor.Sensor does not have type=Occupancy).

I've requested some more sample sensor data in home-assistant/core#121300 so hopefully we can use that to expand the sensor coverage and thus make it safe to do a refactor again.

jaraco commented 2 months ago

See https://github.com/home-assistant/core/issues/121300#issuecomment-2212400007 for some example motion refresh events that might be useful.

jaraco commented 1 month ago

I dealt with this in #31 and #32.