Skip to content

Commit f1fb446

Browse files
authored
Fix deprecated warnings. (#1101)
1 parent 84e582f commit f1fb446

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ Many thanks to:
8787
- [Pyarlo](https://github.com/tchellomello/python-arlo) and [Arlo](https://github.com/jeffreydwalter/arlo) for doing all the hard work figuring the API out and the free Python lesson!
8888
- [sseclient](https://github.com/btubbs/sseclient) for reading from the event stream
8989
- [Button Card](https://github.com/kuuji/button-card/blob/master/button-card.js) for a working Lovelace card I could understand
90-
- [JetBrains](https://www.jetbrains.com/?from=hass-aarlo) for the excellent **PyCharm IDE** and providing me with an open source licence to speed up the project development.
91-
92-
[![JetBrains](images/jetbrains.svg)](https://www.jetbrains.com/?from=hass-aarlo)
9390

9491
## See Also
9592

changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
aarlo
2+
0.8.1.19
3+
fix deprecated warning
24
0.8.1.18
35
fix deprecated warning
46
0.8.1.17

custom_components/aarlo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
from .cfg import BlendedCfg, PyaarloCfg
5555

5656

57-
__version__ = "0.8.1.18"
57+
__version__ = "0.8.1.19"
5858

5959
_LOGGER = logging.getLogger(__name__)
6060

custom_components/aarlo/light.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
import homeassistant.util.color as color_util
1414
from homeassistant.components.light import (
1515
ATTR_BRIGHTNESS,
16-
ATTR_COLOR_TEMP,
16+
ATTR_COLOR_TEMP_KELVIN,
1717
ATTR_EFFECT,
1818
ATTR_HS_COLOR,
1919
ColorMode,
20+
DEFAULT_MAX_KELVIN,
21+
DEFAULT_MIN_KELVIN,
2022
DOMAIN as LIGHT_DOMAIN,
2123
LightEntity,
2224
LightEntityFeature,
@@ -91,6 +93,9 @@ async def async_setup_entry(
9193

9294
class ArloLight(LightEntity):
9395

96+
_attr_min_color_temp_kelvin = DEFAULT_MIN_KELVIN
97+
_attr_max_color_temp_kelvin = DEFAULT_MAX_KELVIN
98+
9499
def __init__(self, light, aarlo_config):
95100
"""Initialize an Arlo light."""
96101

@@ -185,6 +190,7 @@ def __init__(self, camera, aarlo_config):
185190

186191
self._attr_brightness = None
187192
self._attr_color_temp = None
193+
self._attr_color_temp_kelvin = None
188194
self._attr_effect = None
189195
self._attr_effect_list = [LIGHT_EFFECT_NONE, LIGHT_EFFECT_RAINBOW]
190196
self._attr_hs_color = None
@@ -221,6 +227,7 @@ def _set_light_mode(self, light_mode):
221227
self._attr_color_mode = ColorMode.HS
222228
elif mode == "temperature":
223229
temperature = light_mode.get("temperature")
230+
self._attr_color_temp_kevin = temperature
224231
self._attr_color_temp = color_util.color_temperature_kelvin_to_mired(temperature)
225232
self._attr_hs_color = color_util.color_temperature_to_hs(temperature)
226233
self._attr_effect = LIGHT_EFFECT_NONE
@@ -259,11 +266,8 @@ def turn_on(self, **kwargs):
259266
rgb = color_util.color_hs_to_RGB(*kwargs[ATTR_HS_COLOR])
260267
self._light.set_nightlight_rgb(red=rgb[0], green=rgb[1], blue=rgb[2])
261268

262-
if ATTR_COLOR_TEMP in kwargs:
263-
kelvin = color_util.color_temperature_mired_to_kelvin(
264-
kwargs.get(ATTR_COLOR_TEMP)
265-
)
266-
self._light.set_nightlight_color_temperature(kelvin)
269+
if ATTR_COLOR_TEMP_KELVIN in kwargs:
270+
self._light.set_nightlight_color_temperature(kwargs.get(ATTR_COLOR_TEMP_KELVIN))
267271

268272
if ATTR_EFFECT in kwargs:
269273
effect = kwargs[ATTR_EFFECT]

custom_components/aarlo/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"pyaarlo==0.8.0.17",
1717
"aiofiles"
1818
],
19-
"version": "0.8.1.18"
19+
"version": "0.8.1.19"
2020
}

0 commit comments

Comments
 (0)