Skip to content

Commit

Permalink
fix in idle posemapping
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed Oct 19, 2019
1 parent f0d5a13 commit 67c957e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/woofer.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def woofer_queue_default(self,queue_id, old_jsonData):
if self.changedLightsNanoleaf:
self.nanoleaf.Scene(self.changedLightsNanoleaf)
## Reset to Idle lights
elif 'Nanoleaf' in self.settings.PoseMapping['Idle']:
elif 'Idle' in self.settings.PoseMapping and 'Nanoleaf' in self.settings.PoseMapping['Idle']:
self.nanoleaf.Scene(self.settings.PoseMapping['Idle']['Nanoleaf'])
## Turn off lights
else:
Expand All @@ -350,7 +350,7 @@ def woofer_queue_default(self,queue_id, old_jsonData):
self.hue.state(device = device)

## Reset to Idle lights
elif 'Hue' in self.settings.PoseMapping['Idle']:
elif 'Idle' in self.settings.PoseMapping and 'Hue' in self.settings.PoseMapping['Idle']:
for device in self.settings.PoseMapping['Idle']['Hue']:
if 'Brightness' in self.settings.PoseMapping['Idle']['Hue'][device] and self.settings.PoseMapping['Idle']['Hue'][device]['Brightness'] >= 1 and 'Color' in self.settings.PoseMapping['Idle']['Hue'][device] and len(self.settings.PoseMapping['Idle']['Hue'][device]['Color']) >= 6 and len(self.settings.PoseMapping['Idle']['Hue'][device]['Color']) <= 7:
self.hue.state(device = device, bri = self.settings.PoseMapping['Idle']['Hue'][device]['Brightness'], col = self.settings.PoseMapping['Idle']['Hue'][device]['Color'])
Expand Down

0 comments on commit 67c957e

Please sign in to comment.