Fix Roborock send command service calling not being enum (#100574)

This commit is contained in:
Luke Lashley 2023-09-19 10:35:23 -04:00 committed by GitHub
parent a2a62839bc
commit ea78f419a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ class RoborockEntity(Entity):
async def send( async def send(
self, self,
command: RoborockCommand, command: RoborockCommand | str,
params: dict[str, Any] | list[Any] | int | None = None, params: dict[str, Any] | list[Any] | int | None = None,
) -> dict: ) -> dict:
"""Send a command to a vacuum cleaner.""" """Send a command to a vacuum cleaner."""
@ -48,7 +48,7 @@ class RoborockEntity(Entity):
response = await self._api.send_command(command, params) response = await self._api.send_command(command, params)
except RoborockException as err: except RoborockException as err:
raise HomeAssistantError( raise HomeAssistantError(
f"Error while calling {command.name} with {params}" f"Error while calling {command.name if isinstance(command, RoborockCommand) else command} with {params}"
) from err ) from err
return response return response