Use the action field enums in melcloud_home (#195970)

This commit is contained in:
epenet
2026-12-02 09:34:23 +01:00
committed by GitHub
parent 8e821db7d6
commit 928b7914b5
2 changed files with 11 additions and 5 deletions
@@ -15,10 +15,11 @@ from homeassistant.components.climate import (
ClimateEntity,
ClimateEntityDescription,
ClimateEntityFeature,
ClimateServiceArgument,
HVACAction,
HVACMode,
)
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
from homeassistant.const import UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@@ -325,7 +326,8 @@ class ATAClimateEntity(MelCloudHomeATAUnitEntity, ClimateEntity):
await perform_action(
self.coordinator,
self.coordinator.client.control_ata_unit(
self._unit_id, set_temperature=kwargs[ATTR_TEMPERATURE]
self._unit_id,
set_temperature=kwargs[ClimateServiceArgument.TEMPERATURE],
),
)
@@ -539,7 +541,7 @@ class ATWZoneClimateEntity(MelCloudHomeATWZoneEntity, ClimateEntity):
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set the target temperature."""
temperature = kwargs[ATTR_TEMPERATURE]
temperature = kwargs[ClimateServiceArgument.TEMPERATURE]
if self.zone_number == 1:
await perform_action(
self.coordinator,
@@ -8,8 +8,9 @@ from homeassistant.components.water_heater import (
WaterHeaterEntity,
WaterHeaterEntityDescription,
WaterHeaterEntityFeature,
WaterHeaterServiceArgument,
)
from homeassistant.const import ATTR_TEMPERATURE, STATE_OFF, UnitOfTemperature
from homeassistant.const import STATE_OFF, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@@ -110,7 +111,10 @@ class ATWWaterHeater(MelCloudHomeATWUnitEntity, WaterHeaterEntity):
await perform_action(
self.coordinator,
self.coordinator.client.control_atw_unit(
self._unit_id, set_tank_water_temperature=kwargs[ATTR_TEMPERATURE]
self._unit_id,
set_tank_water_temperature=kwargs[
WaterHeaterServiceArgument.TEMPERATURE
],
),
)