Allow MQTT json light floating point transition (#27253)
* MQTT json light: allow floating point transition Allow to use floating point values for the transition time of the MQTT json light. In this way transitions shorter than 1s can be used (0.5 seconds for instance) if the MQTT light supports it. * Always sent a floatpull/27613/head
parent
1774a1427b
commit
2acd3f9e98
|
@ -463,7 +463,7 @@ class MqttLightJson(
|
|||
message["flash"] = self._flash_times[CONF_FLASH_TIME_SHORT]
|
||||
|
||||
if ATTR_TRANSITION in kwargs:
|
||||
message["transition"] = int(kwargs[ATTR_TRANSITION])
|
||||
message["transition"] = kwargs[ATTR_TRANSITION]
|
||||
|
||||
if ATTR_BRIGHTNESS in kwargs and self._brightness is not None:
|
||||
message["brightness"] = int(
|
||||
|
@ -521,7 +521,7 @@ class MqttLightJson(
|
|||
message = {"state": "OFF"}
|
||||
|
||||
if ATTR_TRANSITION in kwargs:
|
||||
message["transition"] = int(kwargs[ATTR_TRANSITION])
|
||||
message["transition"] = kwargs[ATTR_TRANSITION]
|
||||
|
||||
mqtt.async_publish(
|
||||
self.hass,
|
||||
|
|
Loading…
Reference in New Issue