Repository navigation
consumer rfid - #4170
consumer rfid#4170
Conversation
3ceb62d to
dd95f20
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Consumer usage transitions can retain stale RFID authorization, and a parameterized store test fails with a missing call import.
2 open issues
What changed in this PR
Adds end-to-end RFID authorization support for MQTT consumers, including tag acquisition, validation, expiry, reset behavior, state publication, and configuration handling.
Changes:
- Adds RFID configuration, runtime state, authorization, timeout, and reset logic.
- Extends MQTT consumers and stores to receive, publish, and clear RFID data.
- Refactors internal chargepoint client context management and updates RFID messaging.
| File | Description |
|---|---|
packages/modules/internal_chargepoint_handler/internal_chargepoint_handler.py |
Uses ExitStack to manage unique client contexts. |
packages/modules/consumers/generic/mqtt/consumer.py |
Adds MQTT RFID parsing and clearing. |
packages/modules/consumers/generic/mqtt/consumer_test.py |
Tests MQTT RFID state handling and clearing. |
packages/modules/common/store/_consumer.py |
Publishes consumer RFID state to broker topics. |
packages/modules/common/store/_consumer_test.py |
Tests RFID state forwarding. |
packages/modules/common/configurable_consumer.py |
Adds the configurable RFID-clear callback. |
packages/modules/common/component_state.py |
Extends consumer state with RFID fields. |
packages/helpermodules/update_config.py |
Registers consumer RFID topics. |
packages/helpermodules/setdata.py |
Adds validation for consumer RFID topics and values. |
packages/control/consumer/rfid.py |
Implements RFID authorization and expiration logic. |
packages/control/consumer/rfid_test.py |
Tests RFID authorization, reset, and timeout behavior. |
packages/control/consumer/consumer.py |
Integrates RFID processing into the consumer control loop. |
packages/control/consumer/consumer_data.py |
Adds RFID configuration and runtime data fields. |
packages/control/chargepoint/rfid.py |
Updates an RFID assignment error message. |
Review effort: Lite
8f0598f to
e1f21e2
Compare
9bff351 to
b6ecdfa
Compare
0d3ff73 to
bb59938
Compare
bb59938 to
bf4b647
Compare
bf4b647 to
ebaa224
Compare
ebaa224 to
64472b4
Compare
03acfa0 to
06a7535
Compare
06a7535 to
4ad7a73
Compare
…meterized store test' Co-authored-by: Copilot Autofix powered by AI <[email protected]>
4ad7a73 to
8d740ef
Compare
Reviewer's GuideData structuresAdd consumer RFID configuration, input and authorization state, reset modes, and the module protocol that the mixin relies on.
Extend the shared consumer state interface with the RFID tag and its timestamp so modules can return scanned tags.
APIExpose an optional RFID-clearing callback on configurable consumers so control code can acknowledge and clear module input.
Uses of the APIConnect the generic MQTT consumer to the RFID state and clearing callback, returning received tags and publishing clears to the MQTT input topics.
ImplementationImplement consumer RFID matching, input clearing, authorization expiry and reset-after-power-end behavior.
Integrate the RFID mixin into Consumer, update it during operation, and stop control output when RFID authorization is required but absent.
Clarify the chargepoint rejection message to explain that the tag is not associated with a profile or vehicle at that point.
Forward non-null consumer RFID state to the broker without clearing the pending module input.
ConfigurationAdd RFID topic validation and retain the new consumer RFID topics during configuration updates.
TestsTest consumer RFID state clearing, configuration decoding, tag matching, expiry, power-end reset, and authorization behavior.
Test that consumer state publishing forwards RFID values only when present.
Test MQTT RFID reception and that tags are cleared only when the clear callback is invoked.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|


Summary by Sourcery
Implement RFID authorization and lifecycle management for MQTT-backed consumers.
New Features:
Bug Fixes:
Enhancements:
Tests: