Fix small coding style in recent overkiz code (#82966)

* Fix small coding style

* Use kwargs[ATTR_TEMPERATURE] in overkiz water_heater

* Fix grammar

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Nyro 2022-12-02 11:22:35 +01:00 committed by GitHub
parent 5789790d32
commit 21c051935f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -230,7 +230,7 @@ class DomesticHotWaterProduction(OverkizEntity, WaterHeaterEntity):
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
target_temperature = kwargs.get(ATTR_TEMPERATURE)
target_temperature = kwargs[ATTR_TEMPERATURE]
if self.executor.has_command(OverkizCommand.SET_TARGET_TEMPERATURE):
await self.executor.async_execute_command(
@ -299,7 +299,8 @@ class DomesticHotWaterProduction(OverkizEntity, WaterHeaterEntity):
return
if self._is_boost_mode_on:
# We're setting a non Boost mode and the device is currently in Boost mode, the following code remove all boost operations
# We're setting a non Boost mode and the device is currently in Boost mode
# The following code removes all boost operations
if self.executor.has_command(OverkizCommand.SET_BOOST_MODE):
await self.executor.async_execute_command(
OverkizCommand.SET_BOOST_MODE, OverkizCommand.OFF

View File

@ -1,7 +1,7 @@
"""Support for Hitachi DHW."""
from __future__ import annotations
from typing import Any, cast
from typing import Any
from pyoverkiz.enums import OverkizCommand, OverkizCommandParam, OverkizState
@ -63,9 +63,10 @@ class HitachiDHW(OverkizEntity, WaterHeaterEntity):
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
temperature = cast(float, kwargs.get(ATTR_TEMPERATURE))
await self.executor.async_execute_command(
OverkizCommand.SET_CONTROL_DHW_SETTING_TEMPERATURE, int(temperature)
OverkizCommand.SET_CONTROL_DHW_SETTING_TEMPERATURE,
int(kwargs[ATTR_TEMPERATURE]),
)
@property