deCONZ rewrite sensor tests (#26679)

* Improve binary sensor tests

* Fix sensor tests

* Improve readability of binary sensor

* Fix climate tests
Fix sensor platform not loading climate devices as sensors

* Add test to verify adding new sensor after start up
This commit is contained in:
Robert Svensson 2019-09-18 19:07:32 +02:00 committed by Paulus Schoutsen
parent ce42b46ccd
commit 886d8bd6e2
4 changed files with 527 additions and 310 deletions

View file

@ -1,5 +1,5 @@
"""Support for deCONZ sensors."""
from pydeconz.sensor import Consumption, Daylight, LightLevel, Power, Switch
from pydeconz.sensor import Consumption, Daylight, LightLevel, Power, Switch, Thermostat
from homeassistant.const import ATTR_TEMPERATURE, ATTR_VOLTAGE, DEVICE_CLASS_BATTERY
from homeassistant.core import callback
@ -48,7 +48,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
hass.async_create_task(new_event.async_update_device_registry())
gateway.events.append(new_event)
elif not sensor.BINARY:
elif not sensor.BINARY and sensor.type not in Thermostat.ZHATYPE:
new_sensor = DeconzSensor(sensor, gateway)
entity_handler.add_entity(new_sensor)