Skip to content

Commit

Permalink
Fix fix isy994 fan detection (#12595)
Browse files Browse the repository at this point in the history
* Fixed 3 small issues in isy994 component

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.

* Fix ISY994 fan detection

ISY reports "med" in the uom, not "medium"

* Add special-case for FanLincs so the light node is detected properly

* Re-add insteon-type filter for fans, which dropped in a merge error
  • Loading branch information
OverloadUT authored and balloob committed Feb 22, 2018
1 parent c6480e4 commit 184a54c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions homeassistant/components/isy994.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
},
'fan': {
'uom': [],
'states': ['off', 'low', 'medium', 'high'],
'states': ['off', 'low', 'med', 'high'],
'node_def_id': ['FanLincMotor'],
'insteon_type': []
'insteon_type': ['1.46.']
},
'cover': {
'uom': ['97'],
Expand Down Expand Up @@ -173,6 +173,14 @@ def _check_for_insteon_type(hass: HomeAssistant, node,
for domain in domains:
if any([device_type.startswith(t) for t in
set(NODE_FILTERS[domain]['insteon_type'])]):

# Hacky special-case just for FanLinc, which has a light module
# as one of its nodes. Note that this special-case is not necessary
# on ISY 5.x firmware as it uses the superior NodeDefs method
if domain == 'fan' and int(node.nid[-1]) == 1:
hass.data[ISY994_NODES]['light'].append(node)
return True

hass.data[ISY994_NODES][domain].append(node)
return True

Expand Down

0 comments on commit 184a54c

Please sign in to comment.