fixed bean setting bug.
This commit is contained in:
parent
100891e604
commit
fa94782eb9
2 changed files with 2 additions and 1 deletions
|
@ -37,6 +37,7 @@ class StateSingleton:
|
|||
|
||||
def set_desired_expression(self, state):
|
||||
if state in self.states:
|
||||
print("Set desired state to: " + self.states[state])
|
||||
self.desired_expression = self.states[state]
|
||||
self.new_desired_expression = state
|
||||
else:
|
||||
|
|
|
@ -183,7 +183,7 @@ def on_message(client, userdata, message):
|
|||
if bean_state == "rose":
|
||||
proot_state.set_desired_expression(0)
|
||||
elif bean_state == "fell":
|
||||
proot_state.set_desired_expression(bean_number)
|
||||
proot_state.set_desired_expression(int(bean_number))
|
||||
|
||||
|
||||
# MQTT broker configuration
|
||||
|
|
Loading…
Reference in a new issue