mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Tado ignore invalid devices (#10927)
* Ignore devices without temperatures * Typo * Linting * Removing return false * Another typo. :( * Spelling received correctly
This commit is contained in:
parent
31cedf83c7
commit
ef1cbd3aea
@ -59,8 +59,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
||||
climate_devices = []
|
||||
for zone in zones:
|
||||
climate_devices.append(create_climate_device(
|
||||
tado, hass, zone, zone['name'], zone['id']))
|
||||
device = create_climate_device(
|
||||
tado, hass, zone, zone['name'], zone['id'])
|
||||
if not device:
|
||||
continue
|
||||
climate_devices.append(device)
|
||||
|
||||
if climate_devices:
|
||||
add_devices(climate_devices, True)
|
||||
@ -75,8 +78,11 @@ def create_climate_device(tado, hass, zone, name, zone_id):
|
||||
|
||||
if ac_mode:
|
||||
temperatures = capabilities['HEAT']['temperatures']
|
||||
else:
|
||||
elif 'temperatures' in capabilities:
|
||||
temperatures = capabilities['temperatures']
|
||||
else:
|
||||
_LOGGER.debug("Received zone %s has no temperature; not adding", name)
|
||||
return
|
||||
|
||||
min_temp = float(temperatures['celsius']['min'])
|
||||
max_temp = float(temperatures['celsius']['max'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user