hass-core/tests/components/tado/test_sensor.py
J. Nick Koston f42804805c
Move Tado zone state handling into upstream python-tado library (#33195)
* Tado climate state moved to python-tado

* Resolve various incorrect states and add tests for known tado zone states

* Write state instead of calling for an update

This is a redux of pr #32564 with all of the zone state now moved into
python-tado and tests added for the various states.

* stale string

* add missing undos to dispachers

* remove unneeded hass

* naming

* rearrange

* fix water heater, add test

* fix water heater, add test

* switch hvac mode when changing temp if in auto/off/smart
2020-03-30 09:06:26 -05:00

96 lines
2.8 KiB
Python

"""The sensor tests for the tado platform."""
from .util import async_init_integration
async def test_air_con_create_sensors(hass):
"""Test creation of aircon sensors."""
await async_init_integration(hass)
state = hass.states.get("sensor.air_conditioning_power")
assert state.state == "ON"
state = hass.states.get("sensor.air_conditioning_link")
assert state.state == "ONLINE"
state = hass.states.get("sensor.air_conditioning_link")
assert state.state == "ONLINE"
state = hass.states.get("sensor.air_conditioning_tado_mode")
assert state.state == "HOME"
state = hass.states.get("sensor.air_conditioning_temperature")
assert state.state == "24.76"
state = hass.states.get("sensor.air_conditioning_ac")
assert state.state == "ON"
state = hass.states.get("sensor.air_conditioning_overlay")
assert state.state == "True"
state = hass.states.get("sensor.air_conditioning_humidity")
assert state.state == "60.9"
state = hass.states.get("sensor.air_conditioning_open_window")
assert state.state == "False"
async def test_heater_create_sensors(hass):
"""Test creation of heater sensors."""
await async_init_integration(hass)
state = hass.states.get("sensor.baseboard_heater_power")
assert state.state == "ON"
state = hass.states.get("sensor.baseboard_heater_link")
assert state.state == "ONLINE"
state = hass.states.get("sensor.baseboard_heater_link")
assert state.state == "ONLINE"
state = hass.states.get("sensor.baseboard_heater_tado_mode")
assert state.state == "HOME"
state = hass.states.get("sensor.baseboard_heater_temperature")
assert state.state == "20.65"
state = hass.states.get("sensor.baseboard_heater_early_start")
assert state.state == "False"
state = hass.states.get("sensor.baseboard_heater_overlay")
assert state.state == "True"
state = hass.states.get("sensor.baseboard_heater_humidity")
assert state.state == "45.2"
state = hass.states.get("sensor.baseboard_heater_open_window")
assert state.state == "False"
async def test_water_heater_create_sensors(hass):
"""Test creation of water heater sensors."""
await async_init_integration(hass)
state = hass.states.get("sensor.water_heater_tado_mode")
assert state.state == "HOME"
state = hass.states.get("sensor.water_heater_link")
assert state.state == "ONLINE"
state = hass.states.get("sensor.water_heater_overlay")
assert state.state == "False"
state = hass.states.get("sensor.water_heater_power")
assert state.state == "ON"
async def test_home_create_sensors(hass):
"""Test creation of home sensors."""
await async_init_integration(hass)
state = hass.states.get("sensor.home_name_tado_bridge_status")
assert state.state == "True"