Skip to content

Commit

Permalink
Fix deprecated Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrozdnovak committed Jan 7, 2024
1 parent c0896d1 commit 020fc0d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions custom_components/temperature_feels_like/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)
from homeassistant.components.group import expand_entity_ids
from homeassistant.components.number import NumberDeviceClass
from homeassistant.components.sensor import SensorEntity, SensorStateClass
from homeassistant.components.sensor import SensorEntity, SensorStateClass, SensorDeviceClass
from homeassistant.components.weather import (
ATTR_WEATHER_HUMIDITY,
ATTR_WEATHER_TEMPERATURE,
Expand All @@ -26,8 +26,6 @@
CONF_NAME,
CONF_SOURCE,
CONF_UNIQUE_ID,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
EVENT_HOMEASSISTANT_START,
PERCENTAGE,
STATE_UNAVAILABLE,
Expand Down Expand Up @@ -164,7 +162,7 @@ def sensor_startup(event):
unit_of_measurement = state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)

if (
device_class == DEVICE_CLASS_TEMPERATURE
device_class == SensorDeviceClass.TEMPERATURE
or domain in (WEATHER, CLIMATE)
or unit_of_measurement in TEMPERATURE_UNITS
or entity_id.find("temperature") >= 0
Expand All @@ -173,7 +171,7 @@ def sensor_startup(event):
entities.add(entity_id)

if (
device_class == DEVICE_CLASS_HUMIDITY
device_class == SensorDeviceClass.HUMIDITY
or domain in (WEATHER, CLIMATE)
or unit_of_measurement == PERCENTAGE
or entity_id.find("humidity") >= 0
Expand Down

0 comments on commit 020fc0d

Please sign in to comment.