Shelly: fix for RGB devices (#41841)
This commit is contained in:
parent
2b1fc90de7
commit
70eebc7211
1 changed files with 1 additions and 2 deletions
|
@ -28,7 +28,7 @@ def shelly_naming(self, block, entity_type: str):
|
||||||
return f"{entity_name} {self.description.name}"
|
return f"{entity_name} {self.description.name}"
|
||||||
|
|
||||||
channels = 0
|
channels = 0
|
||||||
mode = "relays"
|
mode = block.type + "s"
|
||||||
if "num_outputs" in self.wrapper.device.shelly:
|
if "num_outputs" in self.wrapper.device.shelly:
|
||||||
channels = self.wrapper.device.shelly["num_outputs"]
|
channels = self.wrapper.device.shelly["num_outputs"]
|
||||||
if (
|
if (
|
||||||
|
@ -38,7 +38,6 @@ def shelly_naming(self, block, entity_type: str):
|
||||||
channels = 1
|
channels = 1
|
||||||
if block.type == "emeter" and "num_emeters" in self.wrapper.device.shelly:
|
if block.type == "emeter" and "num_emeters" in self.wrapper.device.shelly:
|
||||||
channels = self.wrapper.device.shelly["num_emeters"]
|
channels = self.wrapper.device.shelly["num_emeters"]
|
||||||
mode = "emeters"
|
|
||||||
if channels > 1 and block.type != "device":
|
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
|
# 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)]:
|
if "name" in self.wrapper.device.settings[mode][int(block.channel)]:
|
||||||
|
|
Loading…
Add table
Reference in a new issue