-
Notifications
You must be signed in to change notification settings - Fork 0
Remove request_tou_settings; there is no MQTT TOU read #125
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,14 +194,15 @@ async def subscribe_tou_response( | |
| device: Device, | ||
| callback: Callable[[TOUReservationSchedule], None], | ||
| ) -> int: | ||
| """Subscribe to Time-of-Use schedule read responses with automatic | ||
| parsing. | ||
| """Subscribe to Time-of-Use schedule write confirmations with | ||
| automatic parsing. | ||
|
|
||
| Subscribes to the ``tou/rd`` response topic for the given device. | ||
| The callback receives a fully-parsed | ||
| :class:`~nwp500.models.TOUReservationSchedule` whenever the device | ||
| responds to a TOU read or configure request (triggered by | ||
| :meth:`request_tou_settings` or :meth:`configure_tou_schedule`). | ||
| :class:`~nwp500.models.TOUReservationSchedule` when the device | ||
| confirms a TOU write (triggered by :meth:`configure_tou_schedule`). | ||
| There is no MQTT read to subscribe to; to read the current schedule, | ||
| use the REST :meth:`~nwp500.NavienAPIClient.get_tou_info`. | ||
|
Comment on lines
+202
to
+205
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 6d7fd96 — the summary line now reads "Subscribe to Time-of-Use schedule write confirmations with automatic parsing." Done on both layers, and |
||
|
|
||
| Args: | ||
| device: Device whose TOU responses to receive. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both halves were wrong, and fixed in 6d7fd96.
There is no REST source for the controller serial — I checked the HAR captures, and the vendor app sends
/device/touacontrollerIdit already holds. The only thing that publishes it is the MQTT device-info response (DeviceFeature.controller_serial_number).So the section no longer claims the whole flow is MQTT-free. It now says the read itself is REST but is keyed by the controller serial, which is a hardware property: fetch it once, cache it, and every later read is pure REST. Example 3 is self-contained — a
get_controller_serial()helper that connects, reads device info and disconnects, and acheck_tou_settings(controller_serial=None)that skips it when you pass a cached value. The parameter list forget_tou_infosays where the serial comes from.Separately: Example 1 read it as
feature.controllerSerialNumber, which the model has no such attribute for. Corrected tocontroller_serial_numberwhile in the same file.