From 2a628908bb9b6cff23835dc26cb0cbe0f5407488 Mon Sep 17 00:00:00 2001 From: iou1name Date: Tue, 2 Jul 2019 09:05:34 -0400 Subject: [PATCH] device_dict.get() instead of device.get() --- models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/models.py b/models.py index 0f00c12..4000d10 100644 --- a/models.py +++ b/models.py @@ -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