Skip to content

Commit cdd6c60

Browse files
committed
Revert "Fixing Issue #52 changed a couple of more places that might trigger undefined index with deConz"
This reverts commit 5553adb.
1 parent c1c78e2 commit cdd6c60

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

logic/action.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _shuffle_group(self, group_id):
4545
lids = utils.get_group_lids(group_id)
4646

4747
# Only shuffle the lights that are on
48-
on_lids = [lid for lid in lids if 'state' in lights[lid] and 'on' in lights[lid]['state'] and lights[lid]['state']['on']]
48+
on_lids = [lid for lid in lids if lights[lid]['state']['on']]
4949
on_xy = [lights[lid]['state']['xy'] for lid in on_lids]
5050
shuffled = list(on_xy)
5151

@@ -60,7 +60,7 @@ def _set_harmony(self, group_id, mode, root):
6060
lids = utils.get_group_lids(group_id)
6161
palette = []
6262

63-
on_lids = [lid for lid in lids if 'state' in lights[lid] and 'on' in lights[lid]['state'] and lights[lid]['state']['on']]
63+
on_lids = [lid for lid in lids if lights[lid]['state']['on']]
6464
args = (len(on_lids), '#%s' % utils.get_color_value(root))
6565
harmony_colors = getattr(harmony, mode)(*args)
6666

logic/filters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class HueActionFilter(HueFilterBase):
221221

222222
def get_items(self, query, id, type, resource):
223223
control = query.split(':')
224-
is_on = (type == self.LIGHT_TYPE and 'state' in resource and 'on' in resource['state'] and resource['state']['on'])
224+
is_on = (type == self.LIGHT_TYPE and resource['state']['on'])
225225
name = resource['name'] if resource else 'All lights'
226226

227227
if type == self.LIGHT_TYPE:

0 commit comments

Comments
 (0)