Skip to content
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

Add holiday extensions to F1155, F1255 #178

Merged
merged 3 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nibe/console_scripts/convert_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 22 in nibe/console_scripts/convert_csv.py

View check run for this annotation

Codecov / codecov/patch

nibe/console_scripts/convert_csv.py#L19-L22

Added lines #L19 - L22 were not covered by tests
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out the d object is a pandas object here and not a dict. pop there does not take a default argument. I think we don't recursively flatten the pandas object to a nested dict.

elif isinstance(v, Mapping):
update_dict(d.setdefault(k, {}), v, removeExplicitNulls)
else:
Expand Down
18 changes: 17 additions & 1 deletion nibe/data/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,24 @@
},
{
"description": "Holiday settings",
"files": ["f750.json"],
"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",
"10": null
}
},
"48044": {
"title": "Holiday - Start Date",
"info": "Days since 1 January 2007",
Expand Down
70 changes: 67 additions & 3 deletions nibe/data/f1155_f1255.json
Original file line number Diff line number Diff line change
Expand Up @@ -5395,17 +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",
"10": "active"
"1": "active"
}
},
"48053": {
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions nibe/data/f750.json
Original file line number Diff line number Diff line change
Expand Up @@ -4447,17 +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",
"10": "active"
"1": "active"
}
},
"48044": {
Expand Down