Skip to content

Commit

Permalink
Has token persistence issue from main.py -> broker_connect.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jmashon committed Jul 12, 2024
1 parent 72d269e commit d41defc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion broker_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def __init__(self):
self.client = None

def connect(self):
print("connect() was called from broker_connect.py")
"""Establish persistent connection with message broker."""
self.client = mqtt.Client()
self.client.username_pw_set(
Expand Down
1 change: 0 additions & 1 deletion broker_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def calibrate_camera(self):

# photo_grid() --> sequence (broker message)


def control_servo(self, pin, angle):
if angle < 0 or angle > 180:
return print("ERROR: Servo angle constrained to 0-180 degrees.")
Expand Down
7 changes: 7 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ def set_info(self, endpoint, field, value, id=None):

def connect(self):
self.broker.broker_connect.connect()

def disconnect(self):
self.broker.broker_connect.disconnect()
return print("Disconnected from message broker.")

def on(self, id):
self.broker.on(id)

0 comments on commit d41defc

Please sign in to comment.