1 """Representation of a thermostat."""
3 from __future__
import annotations
7 from zwave_me_ws
import ZWaveMeData
20 from .const
import DOMAIN, ZWaveMePlatform
21 from .entity
import ZWaveMeEntity
23 TEMPERATURE_DEFAULT_STEP = 0.5
25 DEVICE_NAME = ZWaveMePlatform.CLIMATE
30 config_entry: ConfigEntry,
31 async_add_entities: AddEntitiesCallback,
33 """Set up the climate platform."""
37 """Add a new device."""
38 controller = hass.data[DOMAIN][config_entry.entry_id]
47 config_entry.async_on_unload(
49 hass, f
"ZWAVE_ME_NEW_{DEVICE_NAME.upper()}", add_new_device
55 """Representation of a ZWaveMe sensor."""
57 _attr_hvac_mode = HVACMode.HEAT
58 _attr_hvac_modes = [HVACMode.HEAT]
59 _attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
60 _enable_turn_on_off_backwards_compatibility =
False
63 """Set new target temperature."""
64 if (temperature := kwargs.get(ATTR_TEMPERATURE))
is None:
67 self.
controllercontroller.zwave_api.send_command(
68 self.
devicedevice.id, f
"exact?level={temperature}"
73 """Return the temperature_unit."""
74 return self.
devicedevice.scaleTitle
78 """Return the state of the sensor."""
79 return self.
devicedevice.level
83 """Return min temperature for the device."""
84 return self.
devicedevice.max
88 """Return max temperature for the device."""
89 return self.
devicedevice.min
93 """Return the supported step of target temperature."""
94 return TEMPERATURE_DEFAULT_STEP
float target_temperature(self)
float target_temperature_step(self)
None set_temperature(self, **Any kwargs)
str temperature_unit(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
def add_new_device(new_device)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)