Repository navigation
Conversation
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.
Summary
This PR adds complete Time-of-Use (TOU) slot controls to
deye_hybrid.yaml(Deye single-phase hybrid inverters, e.g. SG0*LP1) and fixes core handling for packed/masked registers when reading and writing.What Was Fixed & Added
Parser & Scaling Order (
parser.py):0x0110–0x0115pack Battery SOC in the low byte (mask: 0x00FF) and Generator SOC in the high byte (mask: 0xFF00,divide: 256).mask,bit,bitmask,divide, andoffsetprocessing before therangecheck in_read_registersand_read_registers_signed. Previously, the raw unmasked 16-bit value (e.g.5160for0x1428) failed validation or displayed incorrectly.Preserve Adjacent Bytes on Write (
entity.py):self.masksupport toSolarmanWritableEntity.write().Gen SOCorBattery SOC), the neighboring byte in the same holding register is now preserved rather than overwritten with zeroes.Divide Scaling on Number Writes (
number.py):self.divideinSolarmanNumberEntity.async_set_native_value(), ensuring values written to high-byte fields (e.g., multiplied by 256) are encoded accurately.TOU Program Slot Entities (
deye_hybrid.yaml):Program 1–6 Gen SOC(number).Program 1–6 Grid Chargeswitch (bit: 0).Program 1–6 Gen Chargeswitch (bit: 1).Program 1–6 Sellswitch with corrected Deye Modbus specification bit (bit: 6).Testing
SUN-6K-SG05LP1-EU).