mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Tado improvements - hot water zone sensors and climate precision (#11521)
* Add tado hot water zone sensors * Set precision to match tado app/website
This commit is contained in:
parent
3972d1d4c6
commit
d2b6660881
@ -6,7 +6,7 @@ https://home-assistant.io/components/climate.tado/
|
||||
"""
|
||||
import logging
|
||||
|
||||
from homeassistant.const import TEMP_CELSIUS
|
||||
from homeassistant.const import (PRECISION_TENTHS, TEMP_CELSIUS)
|
||||
from homeassistant.components.climate import (
|
||||
ClimateDevice, SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE)
|
||||
from homeassistant.const import ATTR_TEMPERATURE
|
||||
@ -192,6 +192,11 @@ class TadoClimate(ClimateDevice):
|
||||
"""Return true if away mode is on."""
|
||||
return self._is_away
|
||||
|
||||
@property
|
||||
def target_temperature_step(self):
|
||||
"""Return the supported step of target temperature."""
|
||||
return PRECISION_TENTHS
|
||||
|
||||
@property
|
||||
def target_temperature(self):
|
||||
"""Return the temperature we try to reach."""
|
||||
|
@ -18,8 +18,10 @@ ATTR_DEVICE = 'device'
|
||||
ATTR_NAME = 'name'
|
||||
ATTR_ZONE = 'zone'
|
||||
|
||||
SENSOR_TYPES = ['temperature', 'humidity', 'power',
|
||||
'link', 'heating', 'tado mode', 'overlay']
|
||||
CLIMATE_SENSOR_TYPES = ['temperature', 'humidity', 'power',
|
||||
'link', 'heating', 'tado mode', 'overlay']
|
||||
|
||||
HOT_WATER_SENSOR_TYPES = ['power', 'link', 'tado mode', 'overlay']
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
@ -35,10 +37,16 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
sensor_items = []
|
||||
for zone in zones:
|
||||
if zone['type'] == 'HEATING':
|
||||
for variable in SENSOR_TYPES:
|
||||
for variable in CLIMATE_SENSOR_TYPES:
|
||||
sensor_items.append(create_zone_sensor(
|
||||
tado, zone, zone['name'], zone['id'],
|
||||
variable))
|
||||
elif zone['type'] == 'HOT_WATER':
|
||||
for variable in HOT_WATER_SENSOR_TYPES:
|
||||
sensor_items.append(create_zone_sensor(
|
||||
tado, zone, zone['name'], zone['id'],
|
||||
variable
|
||||
))
|
||||
|
||||
me_data = tado.get_me()
|
||||
sensor_items.append(create_device_sensor(
|
||||
|
Loading…
x
Reference in New Issue
Block a user