Complete UI for arbitrary dectector settings. Required better method for invoking actions.

Error handling was fixed in the process of getting the above correct.
This commit is contained in:
Julian Stirling 2025-07-28 00:35:24 +01:00
parent 92d15d921b
commit 33413a591a
5 changed files with 102 additions and 25 deletions

View file

@ -10,6 +10,8 @@
v-model="backgroundDetectorStatus.settings"
:data-schema="backgroundDetectorStatus.settings_schema"
label=""
@requestUpdate="readSettings"
@sendValue="writeSettings"
/>
</div>
</li>
@ -72,6 +74,19 @@ export default {
alertImageLabel(r) {
let label = r.output[0] ? "sample" : "background";
this.modalNotify(`Current image is ${label} (${r.output[1]})`);
},
readSettings: async function() {
this.backgroundDetectorStatus = await this.readThingProperty(
"camera",
"background_detector_status"
);
},
writeSettings: async function(requestedValue) {
await this.invokeAction(
"camera",
"update_detector_settings",
{"data": requestedValue}
);
}
},
async created() {