Skip to content

Commit

Permalink
Remove current tea mode from kettle
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Jan 15, 2024
1 parent aa930b8 commit d2c2df0
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions custom_components/yandex_station/water_heater.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ async def async_setup_entry(hass, entry, async_add_entities):
class YandexKettle(WaterHeaterEntity, YandexEntity):
_attr_temperature_unit = UnitOfTemperature.CELSIUS

on_value: bool = None
mode_value: str = None

def internal_init(self, capabilities: dict, properties: dict):
self._attr_operation_list = ["on", "off"] if "on" in capabilities else []

Expand All @@ -47,22 +44,11 @@ def internal_init(self, capabilities: dict, properties: dict):

def internal_update(self, capabilities: dict, properties: dict):
if "on" in capabilities:
self.on_value = capabilities["on"]

if "tea_mode" in capabilities:
self.mode_value = capabilities["tea_mode"]

if self.on_value is False:
self._attr_current_operation = "off"
elif self.mode_value:
self._attr_current_operation = self.mode_value
else:
self._attr_current_operation = "on"

if "temperature" in properties:
self._attr_current_temperature = properties["temperature"]
self._attr_current_operation = "on" if capabilities["on"] else "off"
if "temperature" in capabilities:
self._attr_target_temperature = capabilities["temperature"]
if "temperature" in properties:
self._attr_current_temperature = properties["temperature"]

async def async_set_operation_mode(self, operation_mode):
if operation_mode == "on":
Expand Down

0 comments on commit d2c2df0

Please sign in to comment.