Check value and not just presense of TIMECLOCK and THERMOSTAT attributes.

This commit is contained in:
Andrius Štikonas 2021-01-03 13:34:55 +00:00
parent ec92300199
commit 2fc8544a34
1 changed files with 2 additions and 2 deletions

View File

@ -334,8 +334,8 @@ class NeoHub:
devices = hub_data.devices
delattr(hub_data, "devices")
thermostat_list = list(filter(lambda device: hasattr(device, 'THERMOSTAT'), devices))
timeclock_list = list(filter(lambda device: hasattr(device, 'TIMECLOCK'), devices))
thermostat_list = list(filter(lambda device: hasattr(device, 'THERMOSTAT') and device.THERMOSTAT, devices))
timeclock_list = list(filter(lambda device: hasattr(device, 'TIMECLOCK') and device.TIMECLOCK, devices))
thermostats = []
timeclocks = []