Publish "card swiped" event via MQTT #1496
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a new topic that the MQTT daemon will publish messages on. This is about immediate event-based messages (in contrast to periodic) with currently the only event being the "card swiped" event. It makes use of inotify to watch for changes to the
Latest_RFID
file and immediately sending the card ID to the MQTT server.That way also cards that are not assigned to media or an action within Phoniebox will get relayed to the MQTT server allowing to e.g. control your smart home via the Phoniebox (e.g. having a "dim the lights" card to change lights while not interfering with the current playback).
It's an implementation of the idea presented in #1492 but directly integrated into the MQTT daemon rather than the RFID daemon.