Skip to content

Commit

Permalink
switch fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
grro committed May 26, 2024
1 parent 211d8eb commit a358747
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pi_awning_webthing/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def on_switch_updated(self, pin: int):
logging.info("switch new state " + str(new_state) + " (old " + str(self.state) + ")")
if new_state == self.MOVE_FORWARD:
for anwing in self.awnings:
anwing.set_target_position(100)
anwing.set_position(100)
elif new_state == self.MOVE_BACKWARD:
for anwing in self.awnings:
anwing.set_target_position(0)
anwing.set_position(0)
elif new_state == self.STOP:
for anwing in self.awnings:
current_pos = anwing.get_current_position()
anwing.set_target_position(current_pos)
current_pos = anwing.get_position()
anwing.set_position(current_pos)
else:
pass
except Exception as e:
Expand Down

0 comments on commit a358747

Please sign in to comment.