-
Hi From the example for Dash UI the soltution is given for an arc and a button. For a button it´s:
But I do not realy like the button behaviour on a touch display for text. So I would like to use object type e.g. label for simple data presentation. So e.g. for this Power Value:
May I kindly ask if this text "1000W" is changable by external mqtt publish? Can you inform how to publish to do? Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Easy. Same as what you did with the button. Python code here: def sendProp(plate_name: str, el: str, prop: str, txt: str):
"""Send a property
Args:
plate_name (str): plate name
el (str): element on screen (pXbY)
prop (str): the property
txt (str): text to send
"""
if txt is None:
txt = "[]"
topic = f"hasp/{plate_name}/command/{el}.{prop}"
mi = mqttc.publish(topic, txt)
mi.wait_for_publish() # this does not seem to block until all is gone!
def sendTxt(plate_name: str, el: str, txt: str):
""" send text to a label
Args:
plate_name (str): plate name
el (str): element on screen (pXbY)
txt (str): text to send
"""
if txt is None:
txt = "??"
topic = f"hasp/{plate_name}/command/{el}.text"
mi = mqttc.publish(topic, txt)
mi.wait_for_publish() # this does not seem to block until all is gone! |
Beta Was this translation helpful? Give feedback.
-
You can similarly use Or if you want to change multiple attributes at once: use |
Beta Was this translation helpful? Give feedback.
You can similarly use
hasp/plate35/command/p1b15.text
with payload500W
Or if you want to change multiple attributes at once: use
hasp/plate35/command/jsonl
with payload:{"page":1,"id":15,"text":"1125W",text_color":"#FF0000"}