From b29dedaecf6b4ad024a2cec691fd1bd51614a0bc Mon Sep 17 00:00:00 2001 From: icovada Date: Sun, 17 Apr 2016 19:17:42 +0200 Subject: [PATCH] SCSGATE: Actually cycle through all devices to register (#1841) * SCSGATE: Actually cycle through all devices to register Modify _activate_next_device function to actually cycle through self-devices_to_register instead of simply checking whether there are any and onl registering one * Deleted extra white lines --- homeassistant/components/scsgate.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/scsgate.py b/homeassistant/components/scsgate.py index b231c9668d3..bcbe0affbba 100644 --- a/homeassistant/components/scsgate.py +++ b/homeassistant/components/scsgate.py @@ -98,12 +98,11 @@ class SCSGate: from scsgate.tasks import GetStatusTask with self._devices_to_register_lock: - if len(self._devices_to_register) == 0: - return - _, device = self._devices_to_register.popitem() - self._devices[device.scs_id] = device - self._device_being_registered = device.scs_id - self._reactor.append_task(GetStatusTask(target=device.scs_id)) + while len(self._devices_to_register) != 0: + _, device = self._devices_to_register.popitem() + self._devices[device.scs_id] = device + self._device_being_registered = device.scs_id + self._reactor.append_task(GetStatusTask(target=device.scs_id)) def is_device_registered(self, device_id): """Check whether a device is already registered or not."""