mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-21 06:54:24 +01:00
.
This commit is contained in:
@@ -143,7 +143,6 @@ class HAEntity(panel_cards.Entity):
|
||||
if device_class != "temperature":
|
||||
value = value + " "
|
||||
value = value + unit_of_measurement
|
||||
print(f"fuck {cardType} {value} {self.icon_overwrite}")
|
||||
if cardType in ["cardGrid", "cardGrid2"] and not self.icon_overwrite:
|
||||
icon_char = value
|
||||
|
||||
|
||||
@@ -141,11 +141,36 @@ def setup_panels():
|
||||
libs.panel_cmd.page_type(
|
||||
settings_panel["panelSendTopic"], "pageStartup")
|
||||
|
||||
if __name__ == '__main__':
|
||||
CONFIG_FILE = os.getenv('CONFIG_FILE')
|
||||
if not CONFIG_FILE:
|
||||
CONFIG_FILE = 'config.yml'
|
||||
get_config(CONFIG_FILE)
|
||||
#if __name__ == '__main__':
|
||||
# CONFIG_FILE = os.getenv('CONFIG_FILE')
|
||||
# if not CONFIG_FILE:
|
||||
# CONFIG_FILE = 'config.yml'
|
||||
# get_config(CONFIG_FILE)
|
||||
#connect()
|
||||
#loop()
|
||||
import time
|
||||
from watchdog.observers import Observer
|
||||
from watchdog.events import FileSystemEventHandler
|
||||
|
||||
class MyHandler(FileSystemEventHandler):
|
||||
def on_modified(self, event):
|
||||
print(f'event type: {event.event_type} path : {event.src_path}')
|
||||
def on_created(self, event):
|
||||
print(f'event type: {event.event_type} path : {event.src_path}')
|
||||
def on_deleted(self, event):
|
||||
print(f'event type: {event.event_type} path : {event.src_path}')
|
||||
|
||||
if __name__ == "__main__":
|
||||
event_handler = MyHandler()
|
||||
observer = Observer()
|
||||
observer.schedule(event_handler, path='config.yml', recursive=False)
|
||||
observer.start()
|
||||
|
||||
try:
|
||||
while True:
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
observer.stop()
|
||||
observer.join()
|
||||
|
||||
|
||||
connect()
|
||||
loop()
|
||||
|
||||
Reference in New Issue
Block a user