feat: UI for changing display orientation

* Added UI for changing display orientation.

* Fixed lint issue.
This commit is contained in:
Peder Toftegaard Olsen
2025-05-11 17:17:41 +02:00
committed by GitHub
parent d79f359c43
commit 5a4f1766b7
5 changed files with 75 additions and 0 deletions

View File

@@ -73,6 +73,10 @@ func lvImgSetSrc(objName string, src string) (*CtrlResponse, error) {
return CallCtrlAction("lv_img_set_src", map[string]interface{}{"obj": objName, "src": src})
}
func lvDispSetRotation(rotation string) (*CtrlResponse, error) {
return CallCtrlAction("lv_disp_set_rotation", map[string]interface{}{"rotation": rotation})
}
func updateLabelIfChanged(objName string, newText string) {
if newText != "" && newText != displayedTexts[objName] {
_, _ = lvLabelSetText(objName, newText)
@@ -373,6 +377,7 @@ func init() {
waitCtrlClientConnected()
displayLogger.Info().Msg("setting initial display contents")
time.Sleep(500 * time.Millisecond)
_, _ = lvDispSetRotation(config.DisplayRotation)
updateStaticContents()
displayInited = true
displayLogger.Info().Msg("display inited")