Skip to content

Commit 73cb253

Browse files
committed
Fix deprecation warning for light entity.
1 parent a76cc3a commit 73cb253

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

custom_components/duofern/light.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# found advice in the homeassistant creating components manual
1010
# https://home-assistant.io/developers/creating_components/
1111
# Import the device class from the component that you want to support
12-
from homeassistant.components.light import LightEntity, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, ATTR_BRIGHTNESS
12+
from homeassistant.components.light import ColorMode, LightEntity, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, ATTR_BRIGHTNESS
1313

1414
from homeassistant.core import HomeAssistant
1515

@@ -101,11 +101,11 @@ def brightness(self) -> int|None:
101101
return None
102102

103103
@property
104-
def supported_features(self) -> int: #type: ignore #(This method uses a legacy functionality)
104+
def supported_color_modes(self) -> int: #type: ignore #(This method uses a legacy functionality)
105105
if self._code.startswith("48"):
106-
return SUPPORT_BRIGHTNESS
106+
return ColorMode.BRIGHTNESS
107107
else:
108-
return 0
108+
return ColorMode.ONOFF
109109

110110
def turn_on(self,**kwargs: int) -> None:
111111
if self._code.startswith("48"):

custom_components/duofern/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"issue_tracker": "https://github.com/gluap/pyduofern-hacs/issues" ,
88
"codeowners": ["@gluap"],
99
"requirements": ["pyduofern==0.36.2"],
10-
"version": "0.5.19"
10+
"version": "0.5.20"
1111
}

hacs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "duofern",
33
"domains": ["cover", "light", "binary_sensor"],
4-
"homeassistant": "2022.11"
4+
"homeassistant": "2025.01"
55
}

0 commit comments

Comments
 (0)