Use the action field enums in intellifire (#195791)

This commit is contained in:
epenet
2026-12-01 13:23:56 +01:00
committed by GitHub
parent 2cbac60fa8
commit 2c255dd082
2 changed files with 6 additions and 5 deletions
@@ -6,9 +6,10 @@ from homeassistant.components.climate import (
ClimateEntity,
ClimateEntityDescription,
ClimateEntityFeature,
ClimateServiceArgument,
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
@@ -81,7 +82,7 @@ class IntellifireClimate(IntellifireEntity, ClimateEntity):
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Turn on thermostat by setting a target temperature."""
raw_target_temp = kwargs[ATTR_TEMPERATURE]
raw_target_temp = kwargs[ClimateServiceArgument.TEMPERATURE]
self.last_temp = int(raw_target_temp)
LOGGER.debug(
"Setting target temp to %sc %sf",
@@ -8,10 +8,10 @@ from intellifire4py.control import IntelliFireController
from intellifire4py.model import IntelliFirePollData
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ColorMode,
LightEntity,
LightEntityDescription,
LightServiceArgument,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@@ -68,8 +68,8 @@ class IntellifireLight(IntellifireEntity, LightEntity):
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Instruct the light to turn on."""
if ATTR_BRIGHTNESS in kwargs:
light_level = int(kwargs[ATTR_BRIGHTNESS] / 85)
if LightServiceArgument.BRIGHTNESS in kwargs:
light_level = int(kwargs[LightServiceArgument.BRIGHTNESS] / 85)
else:
light_level = 2