Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions aioshelly/rpc_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def subscribe_updates(self, update_listener: Callable) -> None:
"""Subscribe to device status updates."""
self._update_listener = update_listener

async def trigger_ota_update(self, beta: bool = False) -> None:
"""Trigger an ota update."""
params = {"stage": "beta"} if beta else {"stage": "stable"}
await self._wsrpc.call("Shelly.Update", params)
Copy link
Copy Markdown
Contributor

@mib1185 mib1185 Oct 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chemelli74
would be great if we return the result of this RPC call
opened #151 for that


async def update_status(self) -> None:
"""Get device status from 'Shelly.GetStatus'."""
self._status = await self._wsrpc.call("Shelly.GetStatus")
Expand Down