Make credential setup keyboard-safe and verifiable
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user