check_for_updates
Verify if the Domoticz home automation system has pending updates to install.
Instructions
Check if the Domoticz system has any pending updates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/domoticz_mcp/server.py:903-908 (handler)The actual tool handler function for check_for_updates. It calls the Domoticz JSON API endpoint 'checkforupdate' and returns the response as text.
@mcp.tool() async def check_for_updates() -> str: """Check if the Domoticz system has any pending updates.""" async with create_client() as client: response = await _do_request(client, "GET", f"{DOMOTICZ_API_URL}?type=command¶m=checkforupdate") return response.text - src/domoticz_mcp/server.py:903-904 (registration)The tool is registered via the @mcp.tool() decorator on line 903, which registers it with the FastMCP instance.
@mcp.tool() async def check_for_updates() -> str: - tests/test_server.py:695-700 (helper)Test case for check_for_updates. Mocks the Domoticz API response and verifies the function returns the expected output.
# check_for_updates respx.get(f"{DOMOTICZ_API_URL}?type=command¶m=checkforupdate").mock( return_value=Response(200, json={"status": "OK", "HaveUpdate": False}) ) response = await check_for_updates() assert json.loads(response)["HaveUpdate"] is False