This commit is contained in:
joBr99
2023-11-20 00:30:34 +01:00
parent 19eae41c33
commit 069087c48b
2 changed files with 32 additions and 8 deletions

View File

@@ -143,7 +143,6 @@ class HAEntity(panel_cards.Entity):
if device_class != "temperature": if device_class != "temperature":
value = value + " " value = value + " "
value = value + unit_of_measurement value = value + unit_of_measurement
print(f"fuck {cardType} {value} {self.icon_overwrite}")
if cardType in ["cardGrid", "cardGrid2"] and not self.icon_overwrite: if cardType in ["cardGrid", "cardGrid2"] and not self.icon_overwrite:
icon_char = value icon_char = value

View File

@@ -141,11 +141,36 @@ def setup_panels():
libs.panel_cmd.page_type( libs.panel_cmd.page_type(
settings_panel["panelSendTopic"], "pageStartup") settings_panel["panelSendTopic"], "pageStartup")
if __name__ == '__main__': #if __name__ == '__main__':
CONFIG_FILE = os.getenv('CONFIG_FILE') # CONFIG_FILE = os.getenv('CONFIG_FILE')
if not CONFIG_FILE: # if not CONFIG_FILE:
CONFIG_FILE = 'config.yml' # CONFIG_FILE = 'config.yml'
get_config(CONFIG_FILE) # 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()