Add support for Shelly enum
virtual component (#121997)
* Support enum virtual component * Add tests * Cleaning * Improve test for select * Use values * Update tests * Use the option title for sensor --------- Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
This commit is contained in:
parent
f479b64ff9
commit
bf0e5baa76
8 changed files with 421 additions and 4 deletions
|
@ -323,7 +323,7 @@ def get_rpc_channel_name(device: RpcDevice, key: str) -> str:
|
|||
return f"{device_name} {key.replace(':', '_')}"
|
||||
if key.startswith("em1"):
|
||||
return f"{device_name} EM{key.split(':')[-1]}"
|
||||
if key.startswith(("boolean:", "number:", "text:")):
|
||||
if key.startswith(("boolean:", "enum:", "number:", "text:")):
|
||||
return key.replace(":", " ").title()
|
||||
return device_name
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue