kuukar-rpi/kuukar/kuukar_lcd.py

21 lines
690 B
Python
Raw Normal View History

import kuukar_nextion
2022-10-23 06:49:59 +00:00
class lcd:
def __init__(self) -> None:
self.nextion = kuukar_nextion.nextion()
2022-10-26 05:44:58 +00:00
self.nextion.send_command("page home")
2022-10-23 06:49:59 +00:00
def play_video(self,filename: str) -> None:
2022-10-26 05:44:58 +00:00
self.nextion.send_command("page video_player")
self.nextion.send_command("video.path=\"sd0/"+filename+".video\"")
self.nextion.send_command("video.en=1")
2022-10-23 06:49:59 +00:00
def pause_video(self) -> None:
2022-10-26 05:44:58 +00:00
self.nextion.send_command("video.en=2")
2022-10-23 06:49:59 +00:00
def resume_video(self) -> None:
2022-10-26 05:44:58 +00:00
self.nextion.send_command("video.en=1")
2022-10-23 06:49:59 +00:00
def stop_video(self) -> None:
2022-10-26 05:44:58 +00:00
self.nextion.send_command("video.en=0")
self.nextion.send_command("page home")
2022-10-23 06:49:59 +00:00