Added blink() function, and called it when message receive, and when the face is loaded.
This commit is contained in:
parent
a83da2c004
commit
aa6ef89745
1 changed files with 5 additions and 2 deletions
|
@ -55,6 +55,9 @@ class ProotState:
|
|||
|
||||
return self.current_blink_state
|
||||
|
||||
def blink(self):
|
||||
self.set_desired_blink_state(10)
|
||||
|
||||
def set_desired_blink_state(self, state: int):
|
||||
self.desired_blink_state = state
|
||||
|
||||
|
@ -289,8 +292,8 @@ endT = curr_time = round(time.time()*1000)
|
|||
print("populating matrices for each blink frame took: " + str(endT - startT) + " ms")
|
||||
|
||||
proot_state = ProotState()
|
||||
|
||||
proot_state.set_blinks_frames_ready(True)
|
||||
proot_state.blink()
|
||||
|
||||
|
||||
|
||||
|
@ -304,7 +307,7 @@ def on_message(client, userdata, message):
|
|||
print("Received message '" + str(message.payload) + "' on topic '"
|
||||
+ message.topic + "' with QoS " + str(message.qos))
|
||||
proot_state = ProotState()
|
||||
proot_state.set_desired_blink_state(10)
|
||||
proot_state.blink()
|
||||
|
||||
# MQTT broker configuration
|
||||
broker_address = "10.1.13.173" # Replace with your MQTT broker's address
|
||||
|
|
Loading…
Reference in a new issue