Support multiple connected sensors in HA #122
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.
Multiple connected sensor related changes from #96
I separated from there, because this is also needed for brightness as light, lights need custom topics for state and brightness.
A working implementation of brightness as light is on my branch brightness-light. Compare with this branch #124
Difference from #96:
entities.yaml
, withstate_topic_key
,command_topic_key
options.brightness_command_topic
andcommand_topic
. Oncommand_topic
HA only sends 0 as OFF payload, ON payload only sent onbrightness_command_topic
. The problem with this, after callback, it would send the same callback value to both connected sensors. I solved it by sending through valueformatter, so we can filter and modify the wrong values. To understand this better, see the Brightness as HA light #124 , I will document this somewhere. (I also started rewriting valueformatter to make this more easier...)