Skip to content

Commit

Permalink
fix deprecation (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrozdnovak authored Jan 7, 2024
1 parent 6775a95 commit 95c66b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions custom_components/wellbeing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from custom_components.wellbeing.const import SENSOR, FAN, BINARY_SENSOR
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import TEMP_CELSIUS, PERCENTAGE, CONCENTRATION_PARTS_PER_MILLION, \
from homeassistant.const import UnitOfTemperature, PERCENTAGE, CONCENTRATION_PARTS_PER_MILLION, \
CONCENTRATION_PARTS_PER_BILLION, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER


Expand Down Expand Up @@ -164,7 +164,7 @@ def _create_entities(data):
ApplianceSensor(
name="Temperature",
attr='Temp',
unit=TEMP_CELSIUS,
unit=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE
),
ApplianceSensor(
Expand Down
4 changes: 2 additions & 2 deletions custom_components/wellbeing/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import math

from homeassistant.components.fan import FanEntity, SUPPORT_SET_SPEED, SUPPORT_PRESET_MODE
from homeassistant.components.fan import FanEntity, FanEntityFeature
from homeassistant.util.percentage import percentage_to_ranged_value, ranged_value_to_percentage
from . import WellbeingDataUpdateCoordinator
from .api import Mode
Expand All @@ -13,7 +13,7 @@

_LOGGER: logging.Logger = logging.getLogger(__package__)

SUPPORTED_FEATURES = SUPPORT_SET_SPEED | SUPPORT_PRESET_MODE
SUPPORTED_FEATURES = FanEntityFeature.SET_SPEED | FanEntityFeature.PRESET_MODE

PRESET_MODES = [
Mode.OFF,
Expand Down

0 comments on commit 95c66b3

Please sign in to comment.