Log command list in Bravia TV Remote (#77329)

This commit is contained in:
Artem Draft 2022-08-31 16:58:07 +03:00 committed by GitHub
parent d0375959fd
commit 0aae416425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,4 +255,14 @@ class BraviaTVCoordinator(DataUpdateCoordinator[None]):
"""Send command to device."""
for _ in range(repeats):
for cmd in command:
await self.client.send_command(cmd)
response = await self.client.send_command(cmd)
if not response:
commands = await self.client.get_command_list()
commands_keys = ", ".join(commands.keys())
# Logging an error instead of raising a ValueError
# https://github.com/home-assistant/core/pull/77329#discussion_r955768245
_LOGGER.error(
"Unsupported command: %s, list of available commands: %s",
cmd,
commands_keys,
)