Skip to content

Commit

Permalink
Fixed 3 small issues in isy994 component (home-assistant#12421)
Browse files Browse the repository at this point in the history
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 home-assistant#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 home-assistant#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.
  • Loading branch information
OverloadUT authored and balloob committed Feb 17, 2018
1 parent de7a4b9 commit c9300a9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions homeassistant/components/isy994.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
},
'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'],
Expand All @@ -99,7 +99,7 @@
'node_def_id': ['DimmerLampSwitch', 'DimmerLampSwitch_ADV',
'DimmerSwitchOnly', 'DimmerSwitchOnly_ADV',
'DimmerLampOnly', 'BallastRelayLampSwitch',
'BallastRelayLampSwitch_ADV', 'RelayLampSwitch',
'BallastRelayLampSwitch_ADV',
'RemoteLinc2', 'RemoteLinc2_ADV'],
'insteon_type': ['1.']
},
Expand Down Expand Up @@ -431,7 +431,10 @@ def on_control(self, event: object) -> None:
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:
Expand Down

0 comments on commit c9300a9

Please sign in to comment.