mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 11:33:11 -04:00
Use the action field enums in lyric (#195960)
This commit is contained in:
@@ -10,22 +10,16 @@ from aiolyric.objects.device import LyricDevice
|
||||
from aiolyric.objects.location import LyricLocation
|
||||
|
||||
from homeassistant.components.climate import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
FAN_AUTO,
|
||||
FAN_DIFFUSE,
|
||||
FAN_ON,
|
||||
ClimateEntity,
|
||||
ClimateEntityFeature,
|
||||
ClimateServiceArgument,
|
||||
HVACAction,
|
||||
HVACMode,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_TEMPERATURE,
|
||||
PRECISION_HALVES,
|
||||
PRECISION_WHOLE,
|
||||
UnitOfTemperature,
|
||||
)
|
||||
from homeassistant.const import PRECISION_HALVES, PRECISION_WHOLE, UnitOfTemperature
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||
@@ -307,8 +301,8 @@ class LyricClimate(LyricDeviceEntity, ClimateEntity):
|
||||
return
|
||||
|
||||
device = self.device
|
||||
target_temp_low = kwargs.get(ATTR_TARGET_TEMP_LOW)
|
||||
target_temp_high = kwargs.get(ATTR_TARGET_TEMP_HIGH)
|
||||
target_temp_low = kwargs.get(ClimateServiceArgument.TARGET_TEMP_LOW)
|
||||
target_temp_high = kwargs.get(ClimateServiceArgument.TARGET_TEMP_HIGH)
|
||||
|
||||
if device.changeable_values.mode == LYRIC_HVAC_MODE_HEAT_COOL:
|
||||
if target_temp_low is None or target_temp_high is None:
|
||||
@@ -333,7 +327,7 @@ class LyricClimate(LyricDeviceEntity, ClimateEntity):
|
||||
mode=mode,
|
||||
)
|
||||
else:
|
||||
temp = kwargs.get(ATTR_TEMPERATURE)
|
||||
temp = kwargs.get(ClimateServiceArgument.TEMPERATURE)
|
||||
_LOGGER.debug("Set temperature: %s", temp)
|
||||
if self.hvac_mode == HVACMode.COOL:
|
||||
update = self._update_thermostat(
|
||||
|
||||
Reference in New Issue
Block a user