Make use of str.removeprefix and .removesuffix (#85584)
This commit is contained in:
parent
d44210e573
commit
ae302bbec0
24 changed files with 33 additions and 52 deletions
|
@ -17,9 +17,7 @@ def async_describe_events(hass, async_describe_event):
|
|||
commands = []
|
||||
|
||||
for command_payload in event.data["execution"]:
|
||||
command = command_payload["command"]
|
||||
if command.startswith(COMMON_COMMAND_PREFIX):
|
||||
command = command[len(COMMON_COMMAND_PREFIX) :]
|
||||
command = command_payload["command"].removeprefix(COMMON_COMMAND_PREFIX)
|
||||
commands.append(command)
|
||||
|
||||
message = f"sent command {', '.join(commands)}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue