add ability to recondition display

This commit is contained in:
liamcottle
2025-01-07 01:36:08 +13:00
parent 880b4a1126
commit 73a9c02ada
2 changed files with 47 additions and 1 deletions

View File

@@ -318,7 +318,8 @@
Configure Display (optional)
</div>
<div class="p-3">
<div class="p-3 space-y-2">
<div class="flex space-x-1">
<div class="my-auto">Rotation</div>
<button @click="setDisplayRotation(0)" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
@@ -334,6 +335,17 @@
3
</button>
</div>
<div class="flex space-x-1">
<div class="my-auto">Reconditioning</div>
<button @click="startDisplayReconditioning" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Start
</button>
<button @click="reboot" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Stop
</button>
</div>
</div>
<div class="border-t px-2 py-1 text-sm">
@@ -1764,6 +1776,32 @@
// done
await rnode.close();
},
async startDisplayReconditioning() {
// ask for rnode
const rnode = await this.askForRNode();
if(!rnode){
return;
}
// check if device has been provisioned
const rom = await rnode.getRomAsObject();
const details = rom.parse();
if(!details || !details.is_provisioned){
alert("Eeprom is not provisioned. You must do this first!");
await rnode.close();
return;
}
// configure
console.log("starting display reconditioning");
await rnode.startDisplayReconditioning();
console.log("starting display reconditioning: done");
// done
await rnode.close();
},
async readAsBinaryString(blob) {
return new Promise((resolve, reject) => {