Skip to content

Conversation

@KasparByrne
Copy link

  • Added using standard mqtt client code (Drivers/lib/mqtt_client.py) instead of creating new mqtt client
  • Added logging
  • Added using ArgumentParser from script
  • Create Button class for reusable button code
  • Added publishing button values & info using JSON
  • Changed to using event listener for button presses & releases over previous loop & check
  • Created new MQTT topic for all buttons: bike/{DEVICE_ID}/button
  • Updated lib/mqtt_client.py to use logging & take port argument
  • Moved button code into driver under directory "button_control"

-Now uses Drivers/lib/mqtt_client.py MQTT client code instead of own.

-Rewrote most code to use event listening for button presses instead of looping & sleeping

-Moved button code into own driver folder: button_control

-Created new MQTT topic - bike/{ID}/button - for button communication.

-Now uses parsed arguments from script with defaulting to environment variables rather than hardcoded values.
-Changed to use report sub-topic instead of control sub-topic as the buttons only "sense"
- turns out there was a much cleaner way to import the mqtt_client from lib.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant