The integration will consume the NestQuest API service (Feature 16) over HTTP instead of reading the database. This adds the one module that speaks the panel plane: api_client.py with get_snapshot() and complete_instance(), a typed NestQuestApiError for transport failures and non-2xx responses (carrying the HTTP status so 401/404 are distinguishable), one timeout per request and no retry loops. The HTTP session is injected, so tests exercise the client against a stub transport with no network and no aiohttp; the production factory hands in HA's shared aiohttp session and resolves the base URL and panel service token off the config entry (options, then entry data, then defaults). The two new settings are wired into the options flow like every other section (validation mirrored with the client's constructor rules); the token is a secret and is never logged or echoed into error messages. Coordinator wiring is the next task.
41 lines
1.4 KiB
JSON
41 lines
1.4 KiB
JSON
{
|
|
"title": "NestQuest",
|
|
"config": {
|
|
"step": {
|
|
"user": {
|
|
"title": "Add NestQuest",
|
|
"description": "Set up NestQuest to start coordinating the household. No additional configuration is required."
|
|
}
|
|
},
|
|
"abort": {
|
|
"single_instance_allowed": "NestQuest is already configured. Only a single instance is allowed."
|
|
},
|
|
"create_entry": {
|
|
"default": "NestQuest was successfully configured."
|
|
}
|
|
},
|
|
"options": {
|
|
"step": {
|
|
"init": {
|
|
"title": "NestQuest Settings",
|
|
"description": "Adjust how NestQuest plans, rolls over days, idles its panel, and reaches the NestQuest API service.",
|
|
"data": {
|
|
"horizon_days": "Generation horizon (days)",
|
|
"day_rollover_time": "Day rollover time (HH:MM)",
|
|
"panel_idle_timeout": "Panel idle timeout (seconds)",
|
|
"api_base_url": "NestQuest API base URL (http://host:port)",
|
|
"panel_token": "Panel service token",
|
|
"admin_user_ids": "Admin users (parents)"
|
|
}
|
|
}
|
|
},
|
|
"errors": {
|
|
"invalid": "Invalid value.",
|
|
"invalid_time": "Time must use 24-hour HH:MM format.",
|
|
"invalid_url": "Enter the API base URL as a full http:// or https:// URL with a host.",
|
|
"no_admins": "Select at least one admin user; an empty allowlist would lock everyone out.",
|
|
"invalid_admin": "Invalid admin selection."
|
|
}
|
|
}
|
|
}
|