device_dict.get() instead of device.get()
This commit is contained in:
parent
bd61bb6819
commit
2a628908bb
|
@ -122,8 +122,10 @@ def init_network(filepath="devices.json"):
|
||||||
if device_dict.get('type') == 'RelayDevice':
|
if device_dict.get('type') == 'RelayDevice':
|
||||||
device = RelayDevice().from_dict(device_dict)
|
device = RelayDevice().from_dict(device_dict)
|
||||||
network.append(device)
|
network.append(device)
|
||||||
|
elif device_dict.get('type') == 'LightStrip':
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown device type {device.get('type')}")
|
raise ValueError(f"Unknown device type {device_dict.get('type')}")
|
||||||
return network
|
return network
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user