You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the handling of Device.new, there are some convoluted behaviors in resolving the specialized subclasses of BinarySensor (namely Sensor, Occupancy, and Motion):
In particular, in get_generic_type, the device tags are explicitly managed rather than being associated with a sub_cls and then indicated as "unknown", even though they are known. Then another routine resolve_type_unknown replaces these falsely-unknown types with real types.
This roundabout approach to resolving types is confusing, error-prone, and counter-intuitive, contributing to home-assistant/core#121300 and delaying its resolution.
Let's find a better way.
The text was updated successfully, but these errors were encountered:
Instead of relying on a confusingly-named 'unknown' sentinel, moved these tags to the `Motion` type and gave that type a `.specialize` method to handle the state-sensitive specialization.
Now a truly "unknown" device will resolve to `Unknown` and will be filtered when loading devices.
Closes#28
I did some searching and found MisterWil/abodepy#10 (comment), which seems to indicate that the origin of these two classes is javascript (presumably from the Abode web UI) that alters the labels based on the reported version.
Moreover, there seems to be no examples of a device that returns a version prefixed with "MINIPIR", so this code path may never be activated.
In the handling of
Device.new
, there are some convoluted behaviors in resolving the specialized subclasses of BinarySensor (namelySensor
,Occupancy
, andMotion
):jaraco.abode/jaraco/abode/devices/base.py
Lines 127 to 180 in 595f714
In particular, in
get_generic_type
, the device tags are explicitly managed rather than being associated with a sub_cls and then indicated as "unknown", even though they are known. Then another routineresolve_type_unknown
replaces these falsely-unknown types with real types.This roundabout approach to resolving types is confusing, error-prone, and counter-intuitive, contributing to home-assistant/core#121300 and delaying its resolution.
Let's find a better way.
The text was updated successfully, but these errors were encountered: