Fix bug: call in a proper order, if all devices

This commit is contained in:
Bo Maryniuk 2015-10-13 00:45:50 +02:00 committed by C. R. Oldham
parent a98d5187f8
commit a8e4c2162c

View file

@ -163,7 +163,7 @@ def call_switch(*args, **kwargs):
'''
out = dict()
devices = call_lights()
for dev_id in ('id' not in kwargs and devices.keys() or _get_devices(kwargs)):
for dev_id in ('id' not in kwargs and sorted(devices.keys()) or _get_devices(kwargs)):
if 'on' in kwargs:
state = kwargs['on'] and Const.LAMP_ON or Const.LAMP_OFF
else: