Skip to content
Snippets Groups Projects
Commit 2acd3f9e authored by starkillerOG's avatar starkillerOG Committed by Erik Montnemery
Browse files

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 float
parent 1774a142
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment