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':
|
||||
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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user