device_dict.get() instead of device.get()

This commit is contained in:
iou1name 2019-07-02 09:05:34 -04:00
parent bd61bb6819
commit 2a628908bb

View File

@ -122,8 +122,10 @@ def init_network(filepath="devices.json"):
if device_dict.get('type') == 'RelayDevice':
device = RelayDevice().from_dict(device_dict)
network.append(device)
elif device_dict.get('type') == 'LightStrip':
continue
else:
raise ValueError(f"Unknown device type {device.get('type')}")
raise ValueError(f"Unknown device type {device_dict.get('type')}")
return network