-
Notifications
You must be signed in to change notification settings - Fork 12
Tidy up the use of raw_value #27
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
As per #22 there's a bit of potential confusion around the semantics raw_value. That is, it could mean:
- (My original intention) - the 'raw' value after doing SunSpec conversion of bytes to a value (e.g. a
Uint16) i.e. after callingfrom_registers. - (The interpretation from Clearer outputs for different field types in the CLI and in a JSON export #22) - the 'raw' integer value of an enum.
That's my bad. Realistically, it's only used for scaling decimal fields, so I think the answer here is to refactor the code so that a 'normal' FieldValue doesn't have all this scaling stuff. Maybe create a ScaledFieldValue? Need to think about that. Then ensure there's only one value thing per (Scaled)FieldValue (not two as we currently have value and raw_value).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request