Make credential setup keyboard-safe and verifiable

This commit is contained in:
Gabriel Brown
2026-08-18 06:14:07 -04:00
parent de1b8a7673
commit 3a2295ff53
5 changed files with 70 additions and 9 deletions
@@ -5,7 +5,21 @@ import QtQuick
import qs.services
ShellRoot {
Component.onCompleted: HomeAssistant.fixtureMode = true
id: root
property int refreshCalls: 0
FileView {
id: tokenFile
path: Quickshell.env("PANAMA_TEST_TOKEN_FILE")
blockLoading: true
printErrors: false
}
Component.onCompleted: {
HomeAssistant.fixtureMode = true;
HomeAssistantConfig.refreshHomeAssistant = function() { root.refreshCalls++; };
}
IpcHandler {
target: "home-assistant-config-test"
@@ -14,6 +28,10 @@ ShellRoot {
return HomeAssistantConfig.save(url, entities, "");
}
function saveWithToken(url: string, entities: string): bool {
return HomeAssistantConfig.save(url, entities, tokenFile.text());
}
function clearToken(): bool {
return HomeAssistantConfig.clearToken();
}
@@ -30,7 +48,8 @@ ShellRoot {
configured: HomeAssistantConfig.configured,
busy: HomeAssistantConfig.busy,
lastError: HomeAssistantConfig.lastError,
pendingPayloadEmpty: HomeAssistantConfig.pendingPayload === ""
pendingPayloadEmpty: HomeAssistantConfig.pendingPayload === "",
refreshCalls: root.refreshCalls
});
}
}