HomeCore Controller v0.1.4 fix ingress commissioning
This commit is contained in:
parent
e7576fb090
commit
5d35543444
@ -1,5 +1,13 @@
|
||||
# HomeCore Controller Changelog
|
||||
|
||||
## 0.1.4
|
||||
|
||||
- Fixed Home Assistant Ingress commissioning form routing.
|
||||
- Login and property-selection forms now submit to the ingress root.
|
||||
- Removed dependency on generated Home Assistant sidebar URL prefixes.
|
||||
- Preserves Admin-controlled automatic update system.
|
||||
- Preserves Owner-only existing-home selection and permanent controller binding.
|
||||
|
||||
## 0.1.3
|
||||
|
||||
- Fixed HomeCore commissioning page startup syntax error.
|
||||
|
||||
@ -16,7 +16,7 @@ from cryptography.hazmat.primitives import serialization
|
||||
import uvicorn
|
||||
from updater import start_update_manager
|
||||
|
||||
VERSION = "0.1.3"
|
||||
VERSION = "0.1.4"
|
||||
|
||||
DATA = Path("/config")
|
||||
DATA.mkdir(parents=True, exist_ok=True)
|
||||
@ -280,8 +280,8 @@ def setup_page():
|
||||
'<p>Sign in with the customer\'s HomeCore Owner account. '
|
||||
'You will then choose one of the homes already created in HomeCore.</p>'
|
||||
|
||||
'<form method="post" '
|
||||
"onsubmit=\"return homecoreAction(this,'select-property')\">"
|
||||
'<form method="post" action="">'
|
||||
'<input type="hidden" name="stage" value="select-property">'
|
||||
|
||||
'<label>Owner email</label>'
|
||||
'<input name="email" type="email" autocomplete="email" required>'
|
||||
@ -297,6 +297,39 @@ def setup_page():
|
||||
'</p>'
|
||||
)
|
||||
|
||||
|
||||
@app.post("/", response_class=HTMLResponse)
|
||||
def ingress_form_submit(
|
||||
stage: str = Form(...),
|
||||
email: str = Form(""),
|
||||
password: str = Form(""),
|
||||
nonce: str = Form(""),
|
||||
property_id: str = Form(""),
|
||||
):
|
||||
"""
|
||||
All commissioning forms submit to the ingress root.
|
||||
|
||||
This deliberately avoids nested browser paths because Home Assistant
|
||||
Ingress owns the external URL prefix.
|
||||
"""
|
||||
|
||||
if stage == "select-property":
|
||||
return select_property(
|
||||
email=email,
|
||||
password=password,
|
||||
)
|
||||
|
||||
if stage == "bind":
|
||||
return bind(
|
||||
nonce=nonce,
|
||||
property_id=property_id,
|
||||
)
|
||||
|
||||
return error_page(
|
||||
"Unknown HomeCore setup step."
|
||||
)
|
||||
|
||||
|
||||
@app.post("/select-property", response_class=HTMLResponse)
|
||||
def select_property(
|
||||
email: str = Form(...),
|
||||
@ -368,8 +401,8 @@ def select_property(
|
||||
'<h2>Select the customer home</h2>'
|
||||
'<p>Only homes owned by this HomeCore account can be connected.</p>'
|
||||
|
||||
'<form method="post" '
|
||||
"onsubmit=\"return homecoreAction(this,'bind')\">"
|
||||
'<form method="post" action="">'
|
||||
'<input type="hidden" name="stage" value="bind">'
|
||||
|
||||
f'<input type="hidden" name="nonce" value="{html.escape(nonce)}">'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: HomeCore Controller
|
||||
version: "0.1.3"
|
||||
version: "0.1.4"
|
||||
slug: homecore_controller
|
||||
description: HomeCore local controller agent for Home Assistant Green.
|
||||
url: https://homecore.home-core.co.uk
|
||||
|
||||
Loading…
Reference in New Issue
Block a user