mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Fix xiaomi_miio button platform regression (#100527)
This commit is contained in:
parent
c3f74ae022
commit
7c4f08e6b3
@ -169,8 +169,12 @@ class XiaomiGenericCoordinatedButton(XiaomiCoordinatedMiioEntity, ButtonEntity):
|
|||||||
async def async_press(self) -> None:
|
async def async_press(self) -> None:
|
||||||
"""Press the button."""
|
"""Press the button."""
|
||||||
method = getattr(self._device, self.entity_description.method_press)
|
method = getattr(self._device, self.entity_description.method_press)
|
||||||
await self._try_command(
|
params = self.entity_description.method_press_params
|
||||||
self.entity_description.method_press_error_message,
|
if params is not None:
|
||||||
method,
|
await self._try_command(
|
||||||
self.entity_description.method_press_params,
|
self.entity_description.method_press_error_message, method, params
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
await self._try_command(
|
||||||
|
self.entity_description.method_press_error_message, method
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user