Skip to content

Commit

Permalink
Updating deprecated constants (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
augustas2 committed Jan 25, 2024
1 parent 7f8f5f4 commit 138aaeb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 5 additions & 6 deletions custom_components/eldes_alarm/alarm_control_panel.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"""Interfaces with Eldes control panels."""
import logging

from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
from homeassistant.components.alarm_control_panel import (
AlarmControlPanelEntity,
AlarmControlPanelEntityFeature
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME
)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
Expand Down Expand Up @@ -71,7 +70,7 @@ def extra_state_attributes(self):
@property
def supported_features(self):
"""Return the list of supported features."""
return SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_HOME
return AlarmControlPanelEntityFeature.ARM_AWAY | AlarmControlPanelEntityFeature.ARM_HOME

async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
Expand Down
7 changes: 5 additions & 2 deletions custom_components/eldes_alarm/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
from homeassistant.components.sensor import SensorEntity, SensorDeviceClass
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
from homeassistant.const import (
PERCENTAGE,
UnitOfTemperature
)

from .const import (
DATA_CLIENT,
Expand Down Expand Up @@ -141,7 +144,7 @@ def device_class(self):
@property
def native_unit_of_measurement(self):
"""Return the unit of measurement."""
return TEMP_CELSIUS
return UnitOfTemperature.CELSIUS

@property
def native_value(self):
Expand Down

0 comments on commit 138aaeb

Please sign in to comment.