mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +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
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import TEMP_CELSIUS
|
from homeassistant.const import (PRECISION_TENTHS, TEMP_CELSIUS)
|
||||||
from homeassistant.components.climate import (
|
from homeassistant.components.climate import (
|
||||||
ClimateDevice, SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE)
|
ClimateDevice, SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE)
|
||||||
from homeassistant.const import ATTR_TEMPERATURE
|
from homeassistant.const import ATTR_TEMPERATURE
|
||||||
@ -192,6 +192,11 @@ class TadoClimate(ClimateDevice):
|
|||||||
"""Return true if away mode is on."""
|
"""Return true if away mode is on."""
|
||||||
return self._is_away
|
return self._is_away
|
||||||
|
|
||||||
|
@property
|
||||||
|
def target_temperature_step(self):
|
||||||
|
"""Return the supported step of target temperature."""
|
||||||
|
return PRECISION_TENTHS
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def target_temperature(self):
|
def target_temperature(self):
|
||||||
"""Return the temperature we try to reach."""
|
"""Return the temperature we try to reach."""
|
||||||
|
@ -18,9 +18,11 @@ ATTR_DEVICE = 'device'
|
|||||||
ATTR_NAME = 'name'
|
ATTR_NAME = 'name'
|
||||||
ATTR_ZONE = 'zone'
|
ATTR_ZONE = 'zone'
|
||||||
|
|
||||||
SENSOR_TYPES = ['temperature', 'humidity', 'power',
|
CLIMATE_SENSOR_TYPES = ['temperature', 'humidity', 'power',
|
||||||
'link', 'heating', 'tado mode', 'overlay']
|
'link', 'heating', 'tado mode', 'overlay']
|
||||||
|
|
||||||
|
HOT_WATER_SENSOR_TYPES = ['power', 'link', 'tado mode', 'overlay']
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
"""Set up the sensor platform."""
|
"""Set up the sensor platform."""
|
||||||
@ -35,10 +37,16 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
sensor_items = []
|
sensor_items = []
|
||||||
for zone in zones:
|
for zone in zones:
|
||||||
if zone['type'] == 'HEATING':
|
if zone['type'] == 'HEATING':
|
||||||
for variable in SENSOR_TYPES:
|
for variable in CLIMATE_SENSOR_TYPES:
|
||||||
sensor_items.append(create_zone_sensor(
|
sensor_items.append(create_zone_sensor(
|
||||||
tado, zone, zone['name'], zone['id'],
|
tado, zone, zone['name'], zone['id'],
|
||||||
variable))
|
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()
|
me_data = tado.get_me()
|
||||||
sensor_items.append(create_device_sensor(
|
sensor_items.append(create_device_sensor(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user