mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 06:05:10 +02:00
Homematic Lock: state_uncertain attribute, Homematic dimmer: Light service transition attribute (#22928)
* STATE_UNCERTAIN for Homematic Lock devices introduced Homematic Lock devices provides an uncertain flag if the lock was opened manually an the lock is uncertain regards the status. The other necassary functionality was implemented in pyhomematic by Daniel earlier... * enabled attribute transition in light service for homematic dimmer devices * Update light.py * Revert "Update light.py" This reverts commitf5565a006d
. * Revert "Revert "Update light.py"" This reverts commit2c264826ef
. * fix for line too long error * trailing whitespace
This commit is contained in:
@@ -123,7 +123,8 @@ HM_ATTRIBUTE_SUPPORT = {
|
||||
'CURRENT': ['current', {}],
|
||||
'VOLTAGE': ['voltage', {}],
|
||||
'OPERATING_VOLTAGE': ['voltage', {}],
|
||||
'WORKING': ['working', {0: 'No', 1: 'Yes'}]
|
||||
'WORKING': ['working', {0: 'No', 1: 'Yes'}],
|
||||
'STATE_UNCERTAIN': ['state_uncertain', {}]
|
||||
}
|
||||
|
||||
HM_PRESS_EVENTS = [
|
||||
|
@@ -2,8 +2,8 @@
|
||||
import logging
|
||||
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS, ATTR_EFFECT, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS,
|
||||
SUPPORT_COLOR, SUPPORT_EFFECT, Light)
|
||||
ATTR_BRIGHTNESS, ATTR_EFFECT, ATTR_HS_COLOR, ATTR_TRANSITION,
|
||||
SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_EFFECT, Light)
|
||||
|
||||
from . import ATTR_DISCOVER_DEVICES, HMDevice
|
||||
|
||||
@@ -75,6 +75,9 @@ class HMLight(HMDevice, Light):
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
"""Turn the light on and/or change color or color effect settings."""
|
||||
if ATTR_TRANSITION in kwargs:
|
||||
self._hmdevice.setValue('RAMP_TIME', kwargs[ATTR_TRANSITION])
|
||||
|
||||
if ATTR_BRIGHTNESS in kwargs and self._state == "LEVEL":
|
||||
percent_bright = float(kwargs[ATTR_BRIGHTNESS]) / 255
|
||||
self._hmdevice.set_level(percent_bright, self._channel)
|
||||
|
Reference in New Issue
Block a user