|
13 | 13 | PRESET_NONE,
|
14 | 14 | )
|
15 | 15 | from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
|
| 16 | +from pyoverkiz.enums import OverkizState |
16 | 17 |
|
| 18 | +from ..coordinator import OverkizDataUpdateCoordinator |
17 | 19 | from ..entity import OverkizEntity
|
18 | 20 |
|
19 | 21 | COMMAND_SET_TARGET_TEMPERATURE = "setTargetTemperature"
|
@@ -68,6 +70,11 @@ class AtlanticElectricalTowelDryer(OverkizEntity, ClimateEntity):
|
68 | 70 | _attr_supported_features = SUPPORT_PRESET_MODE | SUPPORT_TARGET_TEMPERATURE
|
69 | 71 | _attr_temperature_unit = TEMP_CELSIUS
|
70 | 72 |
|
| 73 | + def __init__(self, device_url: str, coordinator: OverkizDataUpdateCoordinator): |
| 74 | + """Init method.""" |
| 75 | + super().__init__(device_url, coordinator) |
| 76 | + self.temperature_device = self.executor.linked_device(7) |
| 77 | + |
71 | 78 | @property
|
72 | 79 | def hvac_mode(self) -> str:
|
73 | 80 | """Return hvac operation ie. heat, cool mode."""
|
@@ -103,13 +110,14 @@ def target_temperature(self) -> None:
|
103 | 110 | """Return the temperature."""
|
104 | 111 | if self.hvac_mode == HVAC_MODE_AUTO:
|
105 | 112 | return self.executor.select_state(IO_EFFECTIVE_TEMPERATURE_SETPOINT_STATE)
|
106 |
| - else: |
107 |
| - return self.executor.select_state(CORE_TARGET_TEMPERATURE_STATE) |
| 113 | + return self.executor.select_state(CORE_TARGET_TEMPERATURE_STATE) |
108 | 114 |
|
109 | 115 | @property
|
110 |
| - def current_temperature(self): |
| 116 | + def current_temperature(self) -> float: |
111 | 117 | """Return current temperature."""
|
112 |
| - return self.executor.select_state(CORE_COMFORT_ROOM_TEMPERATURE_STATE) |
| 118 | + return float( |
| 119 | + self.temperature_device.states.get(OverkizState.CORE_TEMPERATURE).value |
| 120 | + ) |
113 | 121 |
|
114 | 122 | async def async_set_temperature(self, **kwargs) -> None:
|
115 | 123 | """Set new temperature."""
|
|
0 commit comments