mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Shelly: fix for RGB devices (#41841)
This commit is contained in:
parent
2b1fc90de7
commit
70eebc7211
@ -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)]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user