Skip to content

Commit 5a1bbcb

Browse files
committed
Update firmware versions with live device data and add DeviceFeature unknown field handling
- Query live device to populate LATEST_KNOWN_FIRMWARE with actual versions: - Controller SW: 184614912 - Panel SW: 0 (not used on NWP500) - WiFi SW: 34013184 - Add unknown field filtering to DeviceFeature.from_dict() - Prevents crashes when new feature fields appear (e.g., recirculationUse) - Consistent with DeviceStatus handling - Logs info message about ignored fields - Update FIRMWARE_TRACKING.rst with observed versions and features - Document heatMinOpTemperature was observed with these versions - Note presence of recirc* fields for future implementation All firmware data collected from live NWP500 device on 2025-10-15.
1 parent 2b486f9 commit 5a1bbcb

3 files changed

Lines changed: 30 additions & 11 deletions

File tree

docs/FIRMWARE_TRACKING.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The following table tracks known fields that have been introduced in firmware up
3838
- Conversion
3939
- Description
4040
* - ``heatMinOpTemperature``
41-
- Unknown version
41+
- Controller: 184614912, WiFi: 34013184
4242
- ``raw + 20``
4343
- Minimum operating temperature for the heating element. Sets the lower threshold at which the heating element can operate.
4444

@@ -125,13 +125,18 @@ Example entry in ``constants.py``:
125125
Firmware Version History
126126
------------------------
127127

128-
This section will be updated as we learn about firmware versions and their changes.
128+
This section tracks observed firmware versions and their associated changes.
129129

130-
**Latest Known Versions** (as of last update):
130+
**Latest Known Versions** (as of 2025-10-15):
131131

132-
- Controller SW Version: TBD
133-
- Panel SW Version: TBD
134-
- WiFi SW Version: TBD
132+
- Controller SW Version: 184614912
133+
- Panel SW Version: 0 (not used on NWP500 devices)
134+
- WiFi SW Version: 34013184
135+
136+
**Observed Features:**
137+
138+
- These versions include support for ``heatMinOpTemperature`` field
139+
- Recirculation pump fields (``recirc*``) are present but not yet documented
135140

136141
*Note: This tracking system was implemented on 2025-10-15. Historical firmware information is not available.*
137142

src/nwp500/constants.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
KNOWN_FIRMWARE_FIELD_CHANGES = {
1717
# Format: "field_name": {"introduced_in": "version", "description": "what it does"}
1818
"heatMinOpTemperature": {
19-
"introduced_in": "unknown", # First observed in production devices
19+
"introduced_in": "Controller: 184614912, WiFi: 34013184",
2020
"description": "Minimum operating temperature for heating element",
2121
"conversion": "raw + 20",
2222
},
2323
}
2424

25-
# Latest known firmware versions (update as new versions are discovered)
25+
# Latest known firmware versions (as of 2025-10-15)
26+
# These versions have been observed with heatMinOpTemperature field
2627
LATEST_KNOWN_FIRMWARE = {
27-
"controllerSwVersion": None, # Update when firmware version is observed
28-
"panelSwVersion": None,
29-
"wifiSwVersion": None,
28+
"controllerSwVersion": 184614912, # Observed on NWP500 device
29+
"panelSwVersion": 0, # Panel SW version not used on this device
30+
"wifiSwVersion": 34013184, # Observed on NWP500 device
3031
}

src/nwp500/models.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ def from_dict(cls, data: dict):
553553
# Copy data to avoid modifying the original dictionary
554554
converted_data = data.copy()
555555

556+
# Get valid field names for this class
557+
valid_fields = {f.name for f in cls.__dataclass_fields__.values()}
558+
556559
# Convert temperature fields with 'raw + 20' formula (same as DeviceStatus)
557560
temp_add_20_fields = [
558561
"dhwTemperatureMin",
@@ -578,6 +581,16 @@ def from_dict(cls, data: dict):
578581
# Default to FAHRENHEIT for unknown temperature types
579582
converted_data["temperatureType"] = TemperatureUnit.FAHRENHEIT
580583

584+
# Filter out any unknown fields (similar to DeviceStatus)
585+
unknown_fields = set(converted_data.keys()) - valid_fields
586+
if unknown_fields:
587+
_logger.info(
588+
"Ignoring unknown fields from device feature: %s. "
589+
"This may indicate new device capabilities from a firmware update.",
590+
unknown_fields,
591+
)
592+
converted_data = {k: v for k, v in converted_data.items() if k in valid_fields}
593+
581594
return cls(**converted_data)
582595

583596

0 commit comments

Comments
 (0)