-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite packet parsing code #249
Open
celsworth
wants to merge
19
commits into
master
Choose a base branch
from
road-to-1-0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
* Improve RegisterCache to support Hold/Input registers And write all incoming data to it * Update CHANGELOG
…ption (#250) * Remove (and enable unconditionally) publish_individual_input config option * Update CHANGELOG
* WIP on new nomless inputs parser * more registers * temporarily throw parsed messages into MQTT for testing * neaten up a bit * remove unparsed registers * small reorg
* Remove old inputs/1/2/3/all publishing * Update CHANGELOG
* Convert HA discovery packets to point at input/status/parsed * Remove unused value_template from Sensors - since they're in their own messages now
* Rework register_cache to support inputs/all * get new data into InfluxDB * Hook up InfluxDB again * remove old code
* Remove ReadInput1/2/3/4/All from codebase * Remove ReadInput1/2/3/4/All from codebase
* Move time register parsing into new parser and out of TimeRegisterOps This should make it easier to generate start/end JSON payloads for registers that require it, on any relevant incoming packets. Small improvement to how we generate and send the message after setting the registers (re-read it back from the inverter). Also fix retain bit for hold publishes. * Update CHANGELOG * remove debug
This was referenced Mar 15, 2024
This looks great, can't wait for it to land! |
* Deal with multi-register holds properly * First pass at reading back time registers when one is set WIP * convert pairs to HashMaps * rename pairs to register_map and set a common type * lint * add rest of registers * remove comment * Update CHANGELOG
// return true if we have a value for ALL the registers requested | ||
fn all_registers_present(&self, registers: &[u16]) -> bool { | ||
registers | ||
.into_iter() |
Check warning
Code scanning / clippy
this .into_iter() call is equivalent to .iter() and will not consume the slice Warning
this .into\_iter() call is equivalent to .iter() and will not consume the slice
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.
This will be a long-lived PR to try and address the list in https://github.com/celsworth/lxp-bridge/issues/245
I'll create smaller separate PRs and merge into this to try and keep it manageable.
This adds a new configuration option,
publish_inputs_all_trigger
. This lives at the root of the config (ie next tologlevel
). By default, this is 80. If you have an inverter which publishes 4 sets of inputs data packets (like newer EG4 inverters with generator inputs) you probably need to bump this to 120 to getinputs/all
sent with all the correct data.However, with this release I'm heavily deprecating the MQTT messages
inputs/1
(and 2 / 3 / 4) andinputs/all
. Please do not use them in any new projects. Instead, use the individual messages published when each register is received. These have topics likeinput/status/parsed
,input/e_pv_day_1/parsed
etc and the payloads are equivalent to the old ones.TODO: