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 authored and Paulus Schoutsen committed 2019-09-18 10:07:32 -07:00
1 parent ce42b46ccd
commit 886d8bd6e2
4 files changed
+527 -310

No files matched your search

+2 -2
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)