Anime: small cleanup

This commit is contained in:
Luke D. Jones
2023-11-15 16:44:39 +13:00
parent 26309776e9
commit 670eee23e8
3 changed files with 49 additions and 61 deletions

View File

@@ -12,6 +12,9 @@ export class AnimeDbus extends DbusBase {
sleep: AnimSleeping.BannerSwipe,
shutdown: AnimShutdown.GlitchOut
},
off_when_unplugged: false,
off_when_suspended: false,
off_when_lid_closed: false,
};
// TODO: interface or something to enforce requirement of "sync()" method
@@ -77,7 +80,10 @@ export class AnimeDbus extends DbusBase {
this.deviceState.builtin_anims.boot = AnimBooting[data[3][0] as AnimBooting];
this.deviceState.builtin_anims.awake = AnimAwake[data[3][1] as AnimAwake];
this.deviceState.builtin_anims.sleep = AnimSleeping[data[3][2] as AnimSleeping];
this.deviceState.builtin_anims.shutdown = AnimShutdown[data[3][2] as AnimShutdown];
this.deviceState.builtin_anims.shutdown = AnimShutdown[data[3][3] as AnimShutdown];
this.deviceState.off_when_unplugged = data[4];
this.deviceState.off_when_suspended = data[5];
this.deviceState.off_when_lid_closed = data[6];
}
}
@@ -86,6 +92,20 @@ export class AnimeDbus extends DbusBase {
try {
// janky shit going on with DeviceStateSync
this._parseData(this.dbus_proxy.DeviceStateSync());
//@ts-ignore
log("Anime Matrix: display_enabled: " + this.deviceState.display_enabled);
//@ts-ignore
log("Anime Matrix: display_brightness: " + this.deviceState.display_brightness);
//@ts-ignore
log("Anime Matrix: builtin_anims_enabled: " + this.deviceState.builtin_anims_enabled);
//@ts-ignore
log("Anime Matrix: builtin_anims: " + this.deviceState.builtin_anims);
//@ts-ignore
log("Anime Matrix: off_when_unplugged: " + this.deviceState.off_when_unplugged);
//@ts-ignore
log("Anime Matrix: off_when_suspended: " + this.deviceState.off_when_suspended);
//@ts-ignore
log("Anime Matrix: off_when_lid_closed: " + this.deviceState.off_when_lid_closed);
} catch (e) {
//@ts-ignore
log("Failed to fetch DeviceState!", e);