Skip to content

Commit

Permalink
Allow FanLinc to parse ramp_rate if group is default
Browse files Browse the repository at this point in the history
Fixes problem where FanLinc scenes read from yaml would all have ramp rate set to 0x1f.
  • Loading branch information
tstabrawa committed Nov 26, 2020
1 parent 0a4e936 commit 4bd65dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions insteon_mqtt/device/FanLinc.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,12 @@ def link_data_from_pretty(self, is_controller, data):
if not is_controller:
if 'group' in data:
data_3 = data['group']
if 'ramp_rate' in data and data['group'] <= 0x01:
data_2 = 0x1f
for ramp_key, ramp_value in Dimmer.ramp_pretty.items():
if data['ramp_rate'] >= ramp_value:
data_2 = ramp_key
break
if 'ramp_rate' in data and (data_3 is None or data_3 == 0x01):
data_2 = 0x1f
for ramp_key, ramp_value in Dimmer.ramp_pretty.items():
if data['ramp_rate'] >= ramp_value:
data_2 = ramp_key
break
if 'on_level' in data:
data_1 = int(data['on_level'] * 2.55 + .5)
return [data_1, data_2, data_3]
Expand Down

0 comments on commit 4bd65dd

Please sign in to comment.