MqttBrokerSensor: grab chart/overlay labels from configured topic names#2906
Open
jerrylewisbh wants to merge 1 commit into
Open
MqttBrokerSensor: grab chart/overlay labels from configured topic names#2906jerrylewisbh wants to merge 1 commit into
jerrylewisbh wants to merge 1 commit into
Conversation
Owner
|
This makes sense. I will take a closer look in a bit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces the static
Topic 1..10labels with names derived from the user's configured topics.Changes
-
mqttBrokerSensor.py: new optional classmethodget_dynamic_labels(pin_1_name)— formats the comma-separated topic list, drops trailing/state, pads to 10 withTopic N.-
capture.py:update_sensor_slot_labels()reads*_PIN_1for slots A–F and usesget_dynamic_labelswhen the driver class implements it. Falls back toMETADATA['labels']otherwise.Backward compatatibility
No new config keys, no schema changes. Every other driver lacks
get_dynamic_labels→ existing path unchanged (verified against BME280, INA228, MPU6050, simulator).Solves: #2905