Simplify some checks for connection types and group size

This commit is contained in:
ChrisTerBeke 2018-12-20 14:26:30 +01:00
parent 2f92f6ef50
commit af2061cd52
3 changed files with 31 additions and 18 deletions

View file

@ -121,10 +121,11 @@ class CloudOutputDeviceManager:
return
device = next((c for c in self._remote_clusters.values() if c.matchesNetworkKey(local_network_key)), None)
if device:
active_machine.setMetaDataEntry(self.META_CLUSTER_ID, device.key)
device.connect()
if not device:
return
active_machine.setMetaDataEntry(self.META_CLUSTER_ID, device.key)
device.connect()
Logger.log("i", "Found cluster %s with network key %s", device, local_network_key)
## Handles an API error received from the cloud.