Skip to content

v0.2.0

  • v0.2.0
  • 379c754
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
  • Choose a tag to compare

  • v0.2.0
  • 379c754
  • Choose a tag to compare

  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
@aaearon aaearon tagged this 30 Apr 18:15
* Fix user_settings/solar_settings/charge_schedule wire format

The cloud wraps each settings document in a {kind}Settings envelope on
both GET and PUT, and PUT additionally requires a transactionId at the
top of the body — none of which 0.1.0 handled. As a result every
UserSettings field parsed as None, and set_user_settings PUTs were
rejected with HTTP 400.

- _get_settings now strips the envelope before returning the inner
  document, so UserSettings.from_dict / SolarSettings.from_dict /
  ChargeSchedule.from_dict see the keys they expect.
- _put_settings re-wraps callers' bodies in {transactionId, {kind}Settings}
  so the API accepts them. Bodies may still be passed pre-wrapped — the
  envelope is detected and reused.
- Verified end-to-end against a live charger: charging_mode now parses
  as ChargeModeSettings(value='PureSolar', allowed_values=['Smart',
  'SmartSolar', 'PureSolar']), and a no-op PUT round-trip is accepted.

Note for callers: enum settings PUTs take the value as a raw string
(e.g. {"chargingMode": "PureSolar"}), not the GET shape with a nested
{value, allowedValues, isChangeAllowed} object.

* Update settings tests for envelope + transactionId wire format
Assets 2
Loading