From 143cbb034f51b26ddcee70f269f9e74d402a603a Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sat, 12 Oct 2024 21:54:50 +0200 Subject: [PATCH 1/3] Add holiday extensions to F1155, F1255 Fixes #175 --- nibe/data/extensions.json | 2 +- nibe/data/f1155_f1255.json | 64 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/nibe/data/extensions.json b/nibe/data/extensions.json index 13de929..c21eb2e 100644 --- a/nibe/data/extensions.json +++ b/nibe/data/extensions.json @@ -499,7 +499,7 @@ }, { "description": "Holiday settings", - "files": ["f750.json"], + "files": ["f750.json", "f1155_f1255.json"], "data": { "48044": { "title": "Holiday - Start Date", diff --git a/nibe/data/f1155_f1255.json b/nibe/data/f1155_f1255.json index 4b224a8..2880ae0 100644 --- a/nibe/data/f1155_f1255.json +++ b/nibe/data/f1155_f1255.json @@ -9579,6 +9579,70 @@ "name": "aux-ers-fire-place-guard-49430", "write": true }, + "48044": { + "title": "Holiday - Start Date", + "info": "Days since 1 January 2007", + "size": "u16", + "factor": 1, + "name": "holiday-start-date-48044", + "write": true, + "type": "date" + }, + "48045": { + "title": "Holiday - End Date", + "info": "Days since 1 January 2007", + "size": "u16", + "factor": 1, + "name": "holiday-end-date-48045", + "write": true, + "type": "date" + }, + "48047": { + "title": "Holiday - HW Comfort Mode", + "info": "-1=Off 0=Economy 1=Normal 2=Luxury", + "size": "s8", + "factor": 1, + "min": -1, + "max": 2, + "default": 1, + "name": "holiday-hot-water-comfort-mode-48047", + "write": true, + "mappings": { + "-1": "Off", + "0": "Economy", + "1": "Normal", + "2": "Luxury" + } + }, + "48048": { + "title": "Holiday - Fan Mode", + "info": "0=Normal 1=Fan speed 1, 2=Fan speed 2, 3=Fan speed 3, 4=Fan speed 4", + "size": "u8", + "factor": 1, + "min": 0, + "max": 4, + "default": 0, + "name": "holiday-fan-mode-48048", + "write": true, + "mappings": { + "0": "Normal", + "1": "Fan mode 1", + "2": "Fan mode 2", + "3": "Fan mode 3", + "4": "Fan mode 4" + } + }, + "48051": { + "title": "Holiday - Room Temperature", + "size": "s16", + "factor": 10, + "name": "holiday-room-temperature-48051", + "write": true, + "unit": "\u00b0C", + "min": 50, + "max": 300, + "default": 200 + }, "40152": { "title": "BT71 Ext. Return Temp", "info": "External return temperature, BT71", From bb3bdf096bb4cb24cc374c85d42aa05268dee7db Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sat, 12 Oct 2024 22:12:35 +0200 Subject: [PATCH 2/3] Adjust the holiday activated field --- nibe/data/extensions.json | 15 +++++++++++++++ nibe/data/f1155_f1255.json | 5 +++-- nibe/data/f750.json | 5 +++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/nibe/data/extensions.json b/nibe/data/extensions.json index c21eb2e..3429bb7 100644 --- a/nibe/data/extensions.json +++ b/nibe/data/extensions.json @@ -501,6 +501,21 @@ "description": "Holiday settings", "files": ["f750.json", "f1155_f1255.json"], "data": { + "48043": { + "title": "Holiday - Activated", + "info": "0=inactive, 1=active", + "size": "u8", + "factor": 1, + "min": 0.0, + "max": 1.0, + "default": 0.0, + "name": "holiday-activated-48043", + "write": true, + "mappings": { + "0": "inactive", + "1": "active" + } + }, "48044": { "title": "Holiday - Start Date", "info": "Days since 1 January 2007", diff --git a/nibe/data/f1155_f1255.json b/nibe/data/f1155_f1255.json index 2880ae0..3dab3ee 100644 --- a/nibe/data/f1155_f1255.json +++ b/nibe/data/f1155_f1255.json @@ -5395,16 +5395,17 @@ }, "48043": { "title": "Holiday - Activated", - "info": "0=inactive, 10=active", + "info": "0=inactive, 1=active", "size": "u8", "factor": 1, "min": 0.0, - "max": 10.0, + "max": 1.0, "default": 0.0, "name": "holiday-activated-48043", "write": true, "mappings": { "0": "inactive", + "1": "active", "10": "active" } }, diff --git a/nibe/data/f750.json b/nibe/data/f750.json index 113c6cc..736f007 100644 --- a/nibe/data/f750.json +++ b/nibe/data/f750.json @@ -4447,16 +4447,17 @@ }, "48043": { "title": "Holiday - Activated", - "info": "0=inactive, 10=active", + "info": "0=inactive, 1=active", "size": "u8", "factor": 1, "min": 0.0, - "max": 10.0, + "max": 1.0, "default": 0.0, "name": "holiday-activated-48043", "write": true, "mappings": { "0": "inactive", + "1": "active", "10": "active" } }, From c09fb08303d914c6a2afce3972fa9c1a9e3c18dc Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sun, 13 Oct 2024 10:55:46 +0200 Subject: [PATCH 3/3] Remove invalid values --- nibe/console_scripts/convert_csv.py | 5 ++++- nibe/data/extensions.json | 3 ++- nibe/data/f1155_f1255.json | 3 +-- nibe/data/f750.json | 3 +-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/nibe/console_scripts/convert_csv.py b/nibe/console_scripts/convert_csv.py index 449dfbd..09a3986 100644 --- a/nibe/console_scripts/convert_csv.py +++ b/nibe/console_scripts/convert_csv.py @@ -16,7 +16,10 @@ def update_dict(d: MutableMapping, u: Mapping, removeExplicitNulls: bool) -> Mapping: for k, v in u.items(): if v is None and removeExplicitNulls: - d.pop(k, None) + try: + d.pop(k) + except (IndexError, KeyError): + pass elif isinstance(v, Mapping): update_dict(d.setdefault(k, {}), v, removeExplicitNulls) else: diff --git a/nibe/data/extensions.json b/nibe/data/extensions.json index 3429bb7..340ae34 100644 --- a/nibe/data/extensions.json +++ b/nibe/data/extensions.json @@ -513,7 +513,8 @@ "write": true, "mappings": { "0": "inactive", - "1": "active" + "1": "active", + "10": null } }, "48044": { diff --git a/nibe/data/f1155_f1255.json b/nibe/data/f1155_f1255.json index 3dab3ee..c336a69 100644 --- a/nibe/data/f1155_f1255.json +++ b/nibe/data/f1155_f1255.json @@ -5405,8 +5405,7 @@ "write": true, "mappings": { "0": "inactive", - "1": "active", - "10": "active" + "1": "active" } }, "48053": { diff --git a/nibe/data/f750.json b/nibe/data/f750.json index 736f007..3e0b044 100644 --- a/nibe/data/f750.json +++ b/nibe/data/f750.json @@ -4457,8 +4457,7 @@ "write": true, "mappings": { "0": "inactive", - "1": "active", - "10": "active" + "1": "active" } }, "48044": {