From 2acd3f9e98763605ad0abe68e5532c79253fc11f Mon Sep 17 00:00:00 2001 From: starkillerOG <starkiller.og@gmail.com> Date: Sun, 13 Oct 2019 20:29:14 +0200 Subject: [PATCH] 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 --- homeassistant/components/mqtt/light/schema_json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/mqtt/light/schema_json.py b/homeassistant/components/mqtt/light/schema_json.py index 1a46cd5e535..1e8114a48e6 100644 --- a/homeassistant/components/mqtt/light/schema_json.py +++ b/homeassistant/components/mqtt/light/schema_json.py @@ -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, -- GitLab