mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 14:37:01 +01:00
47 lines
1.8 KiB
Python
47 lines
1.8 KiB
Python
import logging
|
|
|
|
def custom_send(msg_out_queue, topic, msg):
|
|
msg_out_queue.put((topic, msg))
|
|
logging.debug("Sent Message to NsPanel (%s): %s", topic, msg)
|
|
|
|
|
|
def page_type(msg_out_queue, topic, target_page):
|
|
if target_page == "cardUnlock":
|
|
target_page = "cardAlarm"
|
|
custom_send(msg_out_queue, topic, f"pageType~{target_page}")
|
|
|
|
|
|
def send_time(msg_out_queue, topic, time, addTimeText=""):
|
|
custom_send(msg_out_queue, topic, f"time~{time}~{addTimeText}")
|
|
|
|
|
|
def send_date(msg_out_queue, topic, date):
|
|
custom_send(msg_out_queue, topic, f"date~{date}")
|
|
|
|
|
|
def entityUpd(msg_out_queue, topic, data):
|
|
custom_send(msg_out_queue, topic, f"entityUpd~{data}")
|
|
|
|
def weatherUpdate(msg_out_queue, topic, data):
|
|
custom_send(msg_out_queue, topic, f"weatherUpdate~{data}")
|
|
|
|
def timeout(msg_out_queue, topic, timeout):
|
|
custom_send(msg_out_queue, topic, f"timeout~{timeout}")
|
|
|
|
def dimmode(msg_out_queue, topic, dimValue, dimValueNormal, backgroundColor, fontColor, featExperimentalSliders):
|
|
if dimValue==dimValueNormal:
|
|
dimValue=dimValue-1
|
|
custom_send(msg_out_queue, topic, f"dimmode~{dimValue}~{dimValueNormal}~{backgroundColor}~{fontColor}~{featExperimentalSliders}")
|
|
|
|
def entityUpdateDetail(msg_out_queue, topic, data):
|
|
custom_send(msg_out_queue, topic, f"entityUpdateDetail~{data}")
|
|
|
|
def entityUpdateDetail2(msg_out_queue, topic, data):
|
|
custom_send(msg_out_queue, topic, f"entityUpdateDetail2~{data}")
|
|
|
|
def statusUpdate(msg_out_queue, topic, data):
|
|
custom_send(msg_out_queue, topic, f"statusUpdate~{data}")
|
|
|
|
def send_message_page(msg_out_queue, topic, ident, heading, msg, b1, b2):
|
|
page_type(msg_out_queue, topic, "popupNotify")
|
|
custom_send(msg_out_queue, topic, f"entityUpdateDetail~{ident}~{heading}~65535~{b1}~65535~{b2}~65535~{msg}~65535~0") |