You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.rst
+83Lines changed: 83 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,89 @@
2
2
Changelog
3
3
=========
4
4
5
+
Version 6.0.3 (2025-11-20)
6
+
==========================
7
+
8
+
**BREAKING CHANGES**: Migration from custom dataclass-based models to Pydantic BaseModel implementations with automatic field validation and alias handling.
9
+
10
+
Removed
11
+
-------
12
+
13
+
- Removed legacy dataclass implementations for models (DeviceInfo, Location, Device, FirmwareInfo, DeviceStatus, DeviceFeature, EnergyUsage*). All models now inherit from ``NavienBaseModel`` (Pydantic).
- Removed field metadata conversion system (``meta()`` + ``apply_field_conversions()``) in favor of Pydantic ``BeforeValidator`` pipeline.
16
+
17
+
Changed
18
+
-------
19
+
20
+
- Models now use snake_case attribute names consistently; camelCase keys from API/MQTT are mapped automatically via Pydantic ``alias_generator=to_camel``.
21
+
- Boolean device fields now validated via ``DeviceBool`` Annotated type (device value 2 -> True, 0/1 -> False) replacing manual conversion code.
22
+
- Temperature offset (+20), scale division (/10) and decicelsius-to-Fahrenheit conversions implemented with lightweight ``BeforeValidator`` functions (``Add20``, ``Div10``, ``DeciCelsiusToF``) instead of post-processing.
23
+
- Enum parsing now handled directly by Pydantic; unknown values default safely via explicit Field defaults instead of try/except conversion loops.
24
+
- Field names updated (examples & docs) to snake_case: e.g. ``operationMode`` -> ``operation_mode``, ``dhwTemperatureSetting`` -> ``dhw_temperature_setting``.
25
+
- API typo handled using Field alias (``heLowerOnTDiffempSetting`` -> ``he_lower_on_diff_temp_setting``) rather than custom dictionary mutation.
26
+
- DeviceStatus conversion now performed on parse instead of separate transformation step, improving performance and reducing memory copies.
27
+
- Improved validation error messages from Pydantic on malformed payloads.
28
+
- Simplified energy usage model accessors; removed manual percentage methods duplication.
29
+
30
+
Added
31
+
-----
32
+
33
+
- Introduced ``NavienBaseModel`` configuring alias generation, population by name, and ignoring unknown fields for forward compatibility.
- Added consistent default enum values directly in field declarations (e.g. ``operation_mode=STANDBY``).
36
+
37
+
Migration Guide (v6.0.2 -> v6.0.3)
38
+
----------------------------------
39
+
40
+
1. Replace any imports of dataclass models with Pydantic versions (paths unchanged). No code change required if you only accessed attributes.
41
+
2. Remove calls to ``Model.from_dict(data)``: Either use ``Model.model_validate(data)`` or continue calling ``from_dict`` where still provided (thin wrapper for backward compatibility on some classes). Preferred: ``DeviceStatus.model_validate(raw_payload)``.
42
+
3. Update attribute access to snake_case. Common mappings:
* **Automatic Reconnection**: Reconnects automatically with exponential backoff during network interruptions
27
-
* **Command Queuing**: Commands sent while disconnected are queued and sent automatically when reconnected
28
-
* **Data Models**: Type-safe data classes with automatic unit conversions
24
+
* Async friendly
29
25
30
26
Quick Start
31
27
===========
@@ -119,8 +115,8 @@ The library includes a command line interface for quick monitoring and device in
119
115
**Available CLI Options:**
120
116
121
117
* ``--status``: Print current device status as JSON. Can be combined with control commands to see updated status.
122
-
* ``--device-info``: Print comprehensive device information (firmware, model, capabilities) via MQTT as JSON and exit
123
-
* ``--device-feature``: Print device capabilities and feature settings via MQTT as JSON and exit
118
+
* ``--device-info``: Print comprehensive device information (firmware, model, capabilities) as JSON and exit
119
+
* ``--device-feature``: Print device capabilities and feature settings as JSON and exit
124
120
* ``--power-on``: Turn the device on and display response
125
121
* ``--power-off``: Turn the device off and display response
126
122
* ``--set-mode MODE``: Set operation mode and display response. Valid modes: heat-pump, energy-saver, high-demand, electric, vacation, standby
@@ -161,63 +157,10 @@ The library provides access to comprehensive device status information:
161
157
* Cumulative operation time
162
158
* Flow rates
163
159
164
-
Operation Modes
165
-
===============
166
-
167
-
.. list-table:: Operation Modes
168
-
:header-rows: 1
169
-
:widths: 25 10 65
170
-
171
-
* - Mode
172
-
- ID
173
-
- Description
174
-
* - Heat Pump Mode
175
-
- 1
176
-
- Most energy-efficient mode using only the heat pump. Longest recovery time.
177
-
* - Electric Mode
178
-
- 2
179
-
- Fastest recovery using only electric heaters. Least energy-efficient.
180
-
* - Energy Saver Mode
181
-
- 3
182
-
- Default mode. Balances efficiency and recovery time using both heat pump and electric heater.
183
-
* - High Demand Mode
184
-
- 4
185
-
- Uses electric heater more frequently for faster recovery time.
186
-
* - Vacation Mode
187
-
- 5
188
-
- Suspends heating to save energy during extended absences.
189
-
190
-
**Important:** When you set a mode, you're configuring the ``dhwOperationSetting`` (what mode to use when heating). The device's current operational state is reported in ``operationMode`` (0=Standby, 32=Heat Pump active, 64=Energy Saver active, 96=High Demand active).
191
-
192
-
MQTT Protocol
193
-
=============
194
-
195
-
The library supports low-level MQTT communication with Navien devices:
196
-
197
-
**Control Topics**
198
-
* ``cmd/{deviceType}/{deviceId}/ctrl`` - Send control commands
For detailed information on device status fields, MQTT protocol, authentication, and more, see the complete documentation at https://nwp500-python.readthedocs.io/
163
+
Full docs: https://nwp500-python.readthedocs.io/
221
164
222
165
Data Models
223
166
===========
@@ -228,12 +171,6 @@ The library includes type-safe data models with automatic unit conversions:
228
171
* **DeviceFeature**: Device capabilities, firmware versions, and configuration limits
229
172
* **OperationMode**: Enumeration of available operation modes
0 commit comments