mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Bugfixes HomeKit covers, lights (#13689)
* covers -> current_position attribute * lights -> hue and saturation attribute
This commit is contained in:
parent
301077ded9
commit
f263a931f7
@ -63,14 +63,11 @@ class WindowCovering(HomeAccessory):
|
|||||||
return
|
return
|
||||||
|
|
||||||
current_position = new_state.attributes.get(ATTR_CURRENT_POSITION)
|
current_position = new_state.attributes.get(ATTR_CURRENT_POSITION)
|
||||||
if current_position is None:
|
if isinstance(current_position, int):
|
||||||
return
|
self.current_position = current_position
|
||||||
|
self.char_current_position.set_value(self.current_position)
|
||||||
self.current_position = int(current_position)
|
if self.homekit_target is None or \
|
||||||
self.char_current_position.set_value(self.current_position)
|
abs(self.current_position - self.homekit_target) < 6:
|
||||||
|
self.char_target_position.set_value(self.current_position)
|
||||||
if self.homekit_target is None or \
|
self.char_position_state.set_value(2)
|
||||||
abs(self.current_position - self.homekit_target) < 6:
|
self.homekit_target = None
|
||||||
self.char_target_position.set_value(self.current_position)
|
|
||||||
self.char_position_state.set_value(2)
|
|
||||||
self.homekit_target = None
|
|
||||||
|
@ -146,7 +146,9 @@ class Light(HomeAccessory):
|
|||||||
hue, saturation = new_state.attributes.get(
|
hue, saturation = new_state.attributes.get(
|
||||||
ATTR_HS_COLOR, (None, None))
|
ATTR_HS_COLOR, (None, None))
|
||||||
if not self._flag[RGB_COLOR] and (
|
if not self._flag[RGB_COLOR] and (
|
||||||
hue != self._hue or saturation != self._saturation):
|
hue != self._hue or saturation != self._saturation) and \
|
||||||
|
isinstance(hue, (int, float)) and \
|
||||||
|
isinstance(saturation, (int, float)):
|
||||||
self.char_hue.set_value(hue, should_callback=False)
|
self.char_hue.set_value(hue, should_callback=False)
|
||||||
self.char_saturation.set_value(saturation,
|
self.char_saturation.set_value(saturation,
|
||||||
should_callback=False)
|
should_callback=False)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user