Fixed 3 small issues in isy994 component (#12421)

1. FanLincs have two nodes: one light and one fan motor. In order for each node to get detected as different Hass entity types, I removed the device-type check for FanLinc. The logic will now fall back on the uom checks which should work just fine. (An alternative approach here would be to special case FanLincs and handle them directly - but seeing as the newer 5.x ISY firmware already handles this much better using NodeDefs, I think this quick and dirty approach is fine for the older firmware.) Fixes #12030
2. Some non-dimming switches were appearing as `light`s in Hass due to an duplicate NodeDef being in the light domain filter. Removed! Fixes #12340
3. The `unqiue_id` property was throwing an error for certain entity types that don't have an `_id` property from the ISY. This issue has always been present, but was exposed by the entity registry which seems to be the first thing to actually try reading the `unique_id` property from the isy994 component.
This commit is contained in:
Greg Laabs 2018-02-14 21:58:49 -08:00 committed by Paulus Schoutsen
parent 78c44180f4
commit c25c4c85d6

View File

@ -83,9 +83,9 @@ NODE_FILTERS = {
},
'fan': {
'uom': [],
'states': ['on', 'off', 'low', 'medium', 'high'],
'states': ['off', 'low', 'medium', 'high'],
'node_def_id': ['FanLincMotor'],
'insteon_type': ['1.46.']
'insteon_type': []
},
'cover': {
'uom': ['97'],
@ -99,7 +99,7 @@ NODE_FILTERS = {
'node_def_id': ['DimmerLampSwitch', 'DimmerLampSwitch_ADV',
'DimmerSwitchOnly', 'DimmerSwitchOnly_ADV',
'DimmerLampOnly', 'BallastRelayLampSwitch',
'BallastRelayLampSwitch_ADV', 'RelayLampSwitch',
'BallastRelayLampSwitch_ADV',
'RemoteLinc2', 'RemoteLinc2_ADV'],
'insteon_type': ['1.']
},
@ -433,7 +433,10 @@ class ISYDevice(Entity):
def unique_id(self) -> str:
"""Get the unique identifier of the device."""
# pylint: disable=protected-access
return self._node._id
if hasattr(self._node, '_id'):
return self._node._id
return None
@property
def name(self) -> str: