mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-12 06:44:04 +02:00
support Astral v2
This commit is contained in:
parent
30d85e3ae7
commit
b5eed585ca
1 changed files with 8 additions and 1 deletions
|
|
@ -529,10 +529,17 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
self._transition = min(
|
||||
data[CONF_TRANSITION], self._interval.total_seconds() // 2
|
||||
)
|
||||
_loc = get_astral_location(self.hass)
|
||||
if isinstance(_loc, tuple):
|
||||
# Astral v2.2
|
||||
location, _ = _loc
|
||||
else:
|
||||
# Astral v1
|
||||
location = _loc
|
||||
|
||||
self._sun_light_settings = SunLightSettings(
|
||||
name=self._name,
|
||||
astral_location=get_astral_location(self.hass),
|
||||
astral_location=location,
|
||||
max_brightness=data[CONF_MAX_BRIGHTNESS],
|
||||
max_color_temp=data[CONF_MAX_COLOR_TEMP],
|
||||
min_brightness=data[CONF_MIN_BRIGHTNESS],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue