From b381c5a96d873a6bb1cf0f697364f7e4b7114723 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Sat, 5 Sep 2020 20:14:51 +0200 Subject: [PATCH] make is_sleep a private method --- custom_components/circadian_lighting/switch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 54bb5e92..43b61a88 100755 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -279,7 +279,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): self._hs_color = None self._brightness = None - def is_sleep(self): + def _is_sleep(self): return ( self._sleep_entity is not None and self.hass.states.get(self._sleep_entity).state in self._sleep_state @@ -288,7 +288,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): def _color_temperature(self): return ( self._circadian_lighting._colortemp - if not self.is_sleep() + if not self._is_sleep() else self._sleep_colortemp ) @@ -307,7 +307,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): def _calc_brightness(self) -> float: if self._disable_brightness_adjust: return - if self.is_sleep(): + if self._is_sleep(): return self._sleep_brightness if self._circadian_lighting._percent > 0: return self._max_brightness