From 4034a274f702ee0bb1f69c593c4dca2e7edb0fd7 Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Thu, 11 Feb 2021 11:40:03 +0200 Subject: [PATCH] Fix Shelly relay device set to light appliance type (#46181) --- homeassistant/components/shelly/light.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/shelly/light.py b/homeassistant/components/shelly/light.py index 0c91ddc1088..5422f3fff05 100644 --- a/homeassistant/components/shelly/light.py +++ b/homeassistant/components/shelly/light.py @@ -187,6 +187,11 @@ class ShellyLight(ShellyBlockEntity, LightEntity): async def async_turn_on(self, **kwargs) -> None: """Turn on light.""" + if self.block.type == "relay": + self.control_result = await self.block.set_state(turn="on") + self.async_write_ha_state() + return + params = {"turn": "on"} if ATTR_BRIGHTNESS in kwargs: tmp_brightness = int(kwargs[ATTR_BRIGHTNESS] / 255 * 100)