Skip to content

Commit

Permalink
Fix broken select entity
Browse files Browse the repository at this point in the history
  • Loading branch information
osk2 committed Oct 3, 2021
1 parent 6e16ed0 commit 0e56496
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions custom_components/panasonic_smart_app/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async def async_select_option(self, option: str) -> None:
target_option = list(filter(lambda m: m[0] == option, raw_mode_list))
if len(target_option) > 0:
_LOGGER.debug(f"[{self.label}] Set fan mode to {option}")
await self.client.set_command(self.auth, 142, target_option[0])
await self.client.set_command(self.auth, 142, target_option[0][1])
await self.coordinator.async_request_refresh()
else:
return
Expand Down Expand Up @@ -178,7 +178,7 @@ async def async_select_option(self, option: str) -> None:
target_option = list(filter(lambda m: m[0] == option, raw_mode_list))
if len(target_option) > 0:
_LOGGER.debug(f"[{self.label}] Set motion detection to {option}")
await self.client.set_command(self.auth, 153, target_option[0])
await self.client.set_command(self.auth, 153, target_option[0][1])
await self.coordinator.async_request_refresh()
else:
return
Expand Down Expand Up @@ -228,10 +228,11 @@ async def async_select_option(self, option: str) -> None:
raw_mode_list = list(
filter(lambda c: c["CommandType"] == "0x1f", self.commands)
)[0]["Parameters"]
_LOGGER.debug(raw_mode_list)
target_option = list(filter(lambda m: m[0] == option, raw_mode_list))
if len(target_option) > 0:
_LOGGER.debug(f"[{self.label}] Set indicator light to {option}")
await self.client.set_command(self.auth, 159, target_option[0])
_LOGGER.debug(f"[{self.label}] Set motion detection to {option}")
await self.client.set_command(self.auth, 159, target_option[0][1])
await self.coordinator.async_request_refresh()
else:
return
return

0 comments on commit 0e56496

Please sign in to comment.