Don’t send None value within Command parameter value in Overkiz integration (#71582)

pull/71792/head
Thibaut 2022-05-13 12:36:08 +02:00 committed by GitHub
parent 6cff2f8571
commit 80d332ddf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -68,17 +68,18 @@ class OverkizExecutor:
async def async_execute_command(self, command_name: str, *args: Any) -> None: async def async_execute_command(self, command_name: str, *args: Any) -> None:
"""Execute device command in async context.""" """Execute device command in async context."""
parameters = [arg for arg in args if arg is not None]
# Set the execution duration to 0 seconds for RTS devices on supported commands # Set the execution duration to 0 seconds for RTS devices on supported commands
# Default execution duration is 30 seconds and will block consecutive commands # Default execution duration is 30 seconds and will block consecutive commands
if ( if (
self.device.protocol == Protocol.RTS self.device.protocol == Protocol.RTS
and command_name not in COMMANDS_WITHOUT_DELAY and command_name not in COMMANDS_WITHOUT_DELAY
): ):
args = args + (0,) parameters.append(0)
exec_id = await self.coordinator.client.execute_command( exec_id = await self.coordinator.client.execute_command(
self.device.device_url, self.device.device_url,
Command(command_name, list(args)), Command(command_name, parameters),
"Home Assistant", "Home Assistant",
) )