fix stuff
This commit is contained in:
parent
506615f3a3
commit
c219d7cf5f
|
@ -1,4 +1,3 @@
|
|||
import subprocess
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
import time
|
||||
|
@ -8,7 +7,7 @@ from adafruit_ht16k33 import segments
|
|||
|
||||
__TOPIC_BRIGHTNESS__ = "brightness"
|
||||
__TOPIC_SCROLL_INTERVAL__ = "scroll_interval"
|
||||
__TOPIC_TEXT__ = ""
|
||||
__TOPIC_TEXT__ = "text"
|
||||
|
||||
class Controller:
|
||||
connected = False
|
||||
|
@ -40,6 +39,8 @@ class Controller:
|
|||
self.mqtt.connect(mqtt_host, mqtt_port)
|
||||
self.topic = base_topic
|
||||
|
||||
self.display.print("ABCD")
|
||||
|
||||
|
||||
def on_disconnect(self, client, userdata, rc):
|
||||
print("MQTT disconnected")
|
||||
|
@ -74,7 +75,6 @@ class Controller:
|
|||
self.mqtt.publish(self.topic + "/" + __TOPIC_TEXT__, self.text, 1 )
|
||||
|
||||
|
||||
|
||||
def on_connect(self, client, userdata, flags, rc):
|
||||
print("Connected to MQTT Broker")
|
||||
self.mqtt.subscribe(self.topic + "/#")
|
||||
|
@ -88,9 +88,9 @@ class Controller:
|
|||
self.mqtt.loop()
|
||||
|
||||
if self.display is not None:
|
||||
self.display.print(self.text[self.poscount])
|
||||
##display.print(self.text[self.poscount])
|
||||
display.print(42)
|
||||
self.poscount += 1
|
||||
self.poscount %= len(self.text)
|
||||
time.sleep(self.scroll_interval)
|
||||
|
||||
|
Loading…
Reference in New Issue