Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion custom_components/sonoff/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ async def async_send_command(self, command, **kwargs):

# transform button name to channel number
if not channel.isdigit():
channel = next(k for k, v in self.childs.items() if v.name == channel)
child = next((k for k, v in self.childs.items() if v.name == channel), None)
if child is None:
_LOGGER.error(f"Unknown RF command: {channel}")
continue

channel = child

# cmd param for local and for cloud mode
await self.ewelink.send(
Expand Down
Loading