This commit is contained in:
2026-01-28 17:01:19 +08:00
commit 5932629885
24 changed files with 2454 additions and 0 deletions

20
custom_components/log.py Normal file
View File

@@ -0,0 +1,20 @@
from nicegui import ui
import typing as t
class MyLog(ui.log):
def __init__(self, max_lines: t.Optional[int] = None) -> None:
super().__init__(max_lines)
def debug_emit(self, text: str):
self.push(text, classes = "text-grey")
def info_emit(self, text: str):
self.push(text, classes = "text-blue")
def warning_emit(self, text: str):
self.push(text, classes = "text-orange")
def error_emit(self, text: str):
self.push(text, classes = "text-red")
__all__ = ['MyLog']