From 70eebc72116cf03b130e270c752ccfd64abd2f74 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Wed, 14 Oct 2020 21:09:03 +0200 Subject: [PATCH] Shelly: fix for RGB devices (#41841) --- homeassistant/components/shelly/entity.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/shelly/entity.py b/homeassistant/components/shelly/entity.py index 237deec4da1..7ffd1aee052 100644 --- a/homeassistant/components/shelly/entity.py +++ b/homeassistant/components/shelly/entity.py @@ -28,7 +28,7 @@ def shelly_naming(self, block, entity_type: str): return f"{entity_name} {self.description.name}" channels = 0 - mode = "relays" + mode = block.type + "s" if "num_outputs" in self.wrapper.device.shelly: channels = self.wrapper.device.shelly["num_outputs"] if ( @@ -38,7 +38,6 @@ def shelly_naming(self, block, entity_type: str): channels = 1 if block.type == "emeter" and "num_emeters" in self.wrapper.device.shelly: channels = self.wrapper.device.shelly["num_emeters"] - mode = "emeters" if channels > 1 and block.type != "device": # Shelly EM (SHEM) with firmware v1.8.1 doesn't have "name" key; will be fixed in next firmware release if "name" in self.wrapper.device.settings[mode][int(block.channel)]: