mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 19:57:03 -04:00
Use the action field enums in intellifire (#195791)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user