Skip to content

Commit 4be0b88

Browse files
authored
HA2024.1.0-patch
1 parent 3847986 commit 4be0b88

File tree

1 file changed

+10
-4
lines changed
  • custom_components/midea_dehumidifier

1 file changed

+10
-4
lines changed

custom_components/midea_dehumidifier/sensor.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
For more details please refer to the documentation at
44
https://github.com/barban-dev/midea_inventor_dehumidifier
55
"""
6-
VERSION = '1.0.0'
6+
VERSION = '1.0.4'
77

88
import logging
99
from custom_components.midea_dehumidifier import DOMAIN, MIDEA_TARGET_DEVICE
1010
from homeassistant.helpers.entity import Entity
11-
from homeassistant.const import (DEVICE_CLASS_HUMIDITY)
11+
12+
#patch for HA2024.1.0
13+
#from homeassistant.const import (DEVICE_CLASS_HUMIDITY)
14+
from homeassistant.components.sensor import SensorDeviceClass
1215

1316
from custom_components.midea_dehumidifier.humidifier import ATTR_CURRRENT_HUMIDITY
1417

@@ -45,8 +48,11 @@ def __init__(self, targetDevice, hass):
4548
self._hass = hass
4649
self._name = 'midea_dehumidifier_' + targetDevice['id'] + '_humidity'
4750
self._unique_id = 'midea_dehumidifier_' + targetDevice['id'] + '_humidity'
48-
#self._type = type
49-
self._device_class = DEVICE_CLASS_HUMIDITY
51+
52+
#patch for HA2024.1.0
53+
#self._device_class = DEVICE_CLASS_HUMIDITY
54+
self._device_class = SensorDeviceClass.HUMIDITY
55+
5056
self._unit_of_measurement = '%'
5157
self._icon = 'mdi:water-percent'
5258
#self._battery = battery

0 commit comments

Comments
 (0)