Skip to content

Commit 9a9736d

Browse files
authored
Merge pull request #958 from plugwise/zone_profile
New feature: implement setting Adam zone profile
2 parents 27bfe4a + 6eb34a0 commit 9a9736d

File tree

14 files changed

+227
-35
lines changed

14 files changed

+227
-35
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Versions from 0.40 and up
44

55
## Ongoing
66

7+
- New feature: implement setting Adam zone profile via PR [#958](https://github.com/plugwise/plugwise-beta/pull/958)
78
- Implement translation for added homeassistantError raise message via PR [#948](https://github.com/plugwise/plugwise-beta/pull/948)
89
- Line up strings with Core Plugwise strings via PR [#954](https://github.com/plugwise/plugwise-beta/pull/954)
910

custom_components/plugwise/const.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,15 @@
129129

130130
# Select constants
131131
AVAILABLE_SCHEDULES: Final = "available_schedules"
132-
DHW_MODE: Final = "dhw_mode"
133132
DHW_MODES: Final = "dhw_modes"
134-
GATEWAY_MODE: Final = "gateway_mode"
135133
GATEWAY_MODES: Final = "gateway_modes"
136-
REGULATION_MODE: Final = "regulation_mode"
137134
REGULATION_MODES: Final = "regulation_modes"
135+
ZONE_PROFILES: Final = "zone_profiles"
138136
SELECT_DHW_MODE: Final = "select_dhw_mode"
139137
SELECT_GATEWAY_MODE: Final = "select_gateway_mode"
140138
SELECT_REGULATION_MODE: Final = "select_regulation_mode"
141139
SELECT_SCHEDULE: Final = "select_schedule"
140+
SELECT_ZONE_PROFILE: Final = "select_zone_profile"
142141

143142
# Switch constants
144143
DHW_CM_SWITCH: Final = "dhw_cm_switch"
@@ -198,10 +197,12 @@
198197
"select_gateway_mode",
199198
"select_regulation_mode",
200199
"select_schedule",
200+
"select_zone_profile"
201201
]
202202
type SelectOptionsType = Literal[
203+
"available_schedules",
203204
"dhw_modes",
204205
"gateway_modes",
205206
"regulation_modes",
206-
"available_schedules",
207+
"zone_profiles",
207208
]

custom_components/plugwise/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"integration_type": "hub",
88
"iot_class": "local_polling",
99
"loggers": ["plugwise"],
10-
"requirements": ["plugwise==1.9.0"],
10+
"requirements": ["plugwise==1.10.0"],
1111
"version": "0.60.0",
1212
"zeroconf": ["_plugwise._tcp.local."]
1313
}

custom_components/plugwise/select.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@
1111

1212
from .const import (
1313
AVAILABLE_SCHEDULES,
14-
DHW_MODE,
1514
DHW_MODES,
16-
GATEWAY_MODE,
1715
GATEWAY_MODES,
1816
LOCATION,
1917
LOGGER,
20-
REGULATION_MODE,
2118
REGULATION_MODES,
2219
SELECT_DHW_MODE,
2320
SELECT_GATEWAY_MODE,
2421
SELECT_REGULATION_MODE,
2522
SELECT_SCHEDULE,
23+
SELECT_ZONE_PROFILE,
24+
ZONE_PROFILES,
2625
SelectOptionsType,
2726
SelectType,
2827
)
@@ -43,7 +42,7 @@ class PlugwiseSelectEntityDescription(SelectEntityDescription):
4342
options_key: SelectOptionsType
4443

4544

46-
# Upstream + is there a reason we didn't rename this one prefixed?
45+
# Upstream
4746
SELECT_TYPES = (
4847
PlugwiseSelectEntityDescription(
4948
key=SELECT_SCHEDULE,
@@ -52,22 +51,28 @@ class PlugwiseSelectEntityDescription(SelectEntityDescription):
5251
),
5352
PlugwiseSelectEntityDescription(
5453
key=SELECT_REGULATION_MODE,
55-
translation_key=REGULATION_MODE,
54+
translation_key=SELECT_REGULATION_MODE,
5655
entity_category=EntityCategory.CONFIG,
5756
options_key=REGULATION_MODES,
5857
),
5958
PlugwiseSelectEntityDescription(
6059
key=SELECT_DHW_MODE,
61-
translation_key=DHW_MODE,
60+
translation_key=SELECT_DHW_MODE,
6261
entity_category=EntityCategory.CONFIG,
6362
options_key=DHW_MODES,
6463
),
6564
PlugwiseSelectEntityDescription(
6665
key=SELECT_GATEWAY_MODE,
67-
translation_key=GATEWAY_MODE,
66+
translation_key=SELECT_GATEWAY_MODE,
6867
entity_category=EntityCategory.CONFIG,
6968
options_key=GATEWAY_MODES,
7069
),
70+
PlugwiseSelectEntityDescription(
71+
key=SELECT_ZONE_PROFILE,
72+
translation_key=SELECT_ZONE_PROFILE,
73+
entity_category=EntityCategory.CONFIG,
74+
options_key=ZONE_PROFILES,
75+
),
7176
)
7277

7378

custom_components/plugwise/strings.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
}
114114
},
115115
"select": {
116-
"dhw_mode": {
116+
"select_dhw_mode": {
117117
"name": "DHW mode",
118118
"state": {
119119
"auto": "Auto",
@@ -122,7 +122,7 @@
122122
"off": "Off"
123123
}
124124
},
125-
"regulation_mode": {
125+
"select_regulation_mode": {
126126
"name": "Regulation mode",
127127
"state": {
128128
"bleeding_cold": "Bleeding cold",
@@ -132,7 +132,7 @@
132132
"off": "Off"
133133
}
134134
},
135-
"gateway_mode": {
135+
"select_gateway_mode": {
136136
"name": "Gateway mode",
137137
"state": {
138138
"away": "Pause",
@@ -145,6 +145,14 @@
145145
"state": {
146146
"off": "Off"
147147
}
148+
},
149+
"select_zone_profile": {
150+
"name": "Zone profile",
151+
"state": {
152+
"active": "Active",
153+
"off": "Off",
154+
"passive": "Passive"
155+
}
148156
}
149157
},
150158
"sensor": {

custom_components/plugwise/translations/en.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
}
9797
},
9898
"select": {
99-
"dhw_mode": {
99+
"select_dhw_mode": {
100100
"name": "DHW mode",
101101
"state": {
102102
"auto": "Auto",
@@ -105,15 +105,15 @@
105105
"off": "Off"
106106
}
107107
},
108-
"gateway_mode": {
108+
"select_gateway_mode": {
109109
"name": "Gateway mode",
110110
"state": {
111111
"away": "Pause",
112112
"full": "Normal",
113113
"vacation": "Vacation"
114114
}
115115
},
116-
"regulation_mode": {
116+
"select_regulation_mode": {
117117
"name": "Regulation mode",
118118
"state": {
119119
"bleeding_cold": "Bleeding cold",
@@ -128,6 +128,14 @@
128128
"state": {
129129
"off": "Off"
130130
}
131+
},
132+
"select_zone_profile": {
133+
"name": "Zone profile",
134+
"state": {
135+
"active": "Active",
136+
"off": "Off",
137+
"passive": "Passive"
138+
}
131139
}
132140
},
133141
"sensor": {

custom_components/plugwise/translations/nl.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
}
112112
},
113113
"select": {
114-
"dhw_mode": {
114+
"select_dhw_mode": {
115115
"name": "Modus huishoudelijk warmwater",
116116
"state": {
117117
"auto": "Auto",
@@ -120,7 +120,7 @@
120120
"off": "Uit"
121121
}
122122
},
123-
"regulation_mode": {
123+
"select_regulation_mode": {
124124
"name": "Regelmodus",
125125
"state": {
126126
"bleeding_cold": "Koud ontluchten",
@@ -130,7 +130,7 @@
130130
"off": "Uit"
131131
}
132132
},
133-
"gateway_mode": {
133+
"select_gateway_mode": {
134134
"name": "Gateway mode",
135135
"state": {
136136
"away": "Pauze",
@@ -143,6 +143,14 @@
143143
"state": {
144144
"off": "Uit"
145145
}
146+
},
147+
"select_zone_profile": {
148+
"name": "Zone profiel",
149+
"state": {
150+
"active": "Actief",
151+
"off": "Uit",
152+
"passive": "Passief"
153+
}
146154
}
147155
},
148156
"sensor": {

tests/components/plugwise/fixtures/adam_plus_anna_new/data.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@
280280
"name": "Living room",
281281
"preset_modes": ["vacation", "no_frost", "asleep", "home", "away"],
282282
"select_schedule": "Weekschema",
283+
"select_zone_profile": "active",
283284
"sensors": {
284285
"electricity_consumed": 60.8,
285286
"electricity_produced": 0.0,
@@ -299,7 +300,8 @@
299300
],
300301
"secondary": []
301302
},
302-
"vendor": "Plugwise"
303+
"vendor": "Plugwise",
304+
"zone_profiles": ["active", "off", "passive"]
303305
},
304306
"f871b8c4d63549319221e294e4f88074": {
305307
"active_preset": "vacation",
@@ -317,6 +319,7 @@
317319
"name": "Bathroom",
318320
"preset_modes": ["vacation", "no_frost", "asleep", "home", "away"],
319321
"select_schedule": "off",
322+
"select_zone_profile": "passive",
320323
"sensors": {
321324
"electricity_consumed": 0.0,
322325
"electricity_produced": 0.0,
@@ -332,6 +335,7 @@
332335
"primary": ["e2f4322d57924fa090fbbc48b3a140dc"],
333336
"secondary": ["1772a4ea304041adb83f357b751341ff"]
334337
},
335-
"vendor": "Plugwise"
338+
"vendor": "Plugwise",
339+
"zone_profiles": ["active", "off", "passive"]
336340
}
337341
}

tests/components/plugwise/fixtures/m_adam_cooling/data.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
"name": "Living room",
197197
"preset_modes": ["vacation", "no_frost", "asleep", "home", "away"],
198198
"select_schedule": "off",
199+
"select_zone_profile": "active",
199200
"sensors": {
200201
"electricity_consumed": 60.8,
201202
"electricity_produced": 0.0,
@@ -215,7 +216,8 @@
215216
],
216217
"secondary": []
217218
},
218-
"vendor": "Plugwise"
219+
"vendor": "Plugwise",
220+
"zone_profiles": ["active", "off", "passive"]
219221
},
220222
"f871b8c4d63549319221e294e4f88074": {
221223
"active_preset": "vacation",
@@ -233,6 +235,7 @@
233235
"name": "Bathroom",
234236
"preset_modes": ["vacation", "no_frost", "asleep", "home", "away"],
235237
"select_schedule": "off",
238+
"select_zone_profile": "passive",
236239
"sensors": {
237240
"electricity_consumed": 0.0,
238241
"electricity_produced": 0.0,
@@ -248,6 +251,7 @@
248251
"primary": ["e2f4322d57924fa090fbbc48b3a140dc"],
249252
"secondary": ["1772a4ea304041adb83f357b751341ff"]
250253
},
251-
"vendor": "Plugwise"
254+
"vendor": "Plugwise",
255+
"zone_profiles": ["active", "off", "passive"]
252256
}
253257
}

tests/components/plugwise/fixtures/m_adam_heating/data.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195
"name": "Living room",
196196
"preset_modes": ["vacation", "no_frost", "asleep", "home", "away"],
197197
"select_schedule": "off",
198+
"select_zone_profile": "active",
198199
"sensors": {
199200
"electricity_consumed": 60.8,
200201
"electricity_produced": 0.0,
@@ -214,7 +215,8 @@
214215
],
215216
"secondary": []
216217
},
217-
"vendor": "Plugwise"
218+
"vendor": "Plugwise",
219+
"zone_profiles": ["active", "off", "passive"]
218220
},
219221
"f871b8c4d63549319221e294e4f88074": {
220222
"active_preset": "vacation",
@@ -232,6 +234,7 @@
232234
"name": "Bathroom",
233235
"preset_modes": ["vacation", "no_frost", "asleep", "home", "away"],
234236
"select_schedule": "off",
237+
"select_zone_profile": "passive",
235238
"sensors": {
236239
"electricity_consumed": 0.0,
237240
"electricity_produced": 0.0,
@@ -247,6 +250,7 @@
247250
"primary": ["e2f4322d57924fa090fbbc48b3a140dc"],
248251
"secondary": ["1772a4ea304041adb83f357b751341ff"]
249252
},
250-
"vendor": "Plugwise"
253+
"vendor": "Plugwise",
254+
"zone_profiles": ["active", "off", "passive"]
251255
}
252256
}

0 commit comments

Comments
 (0)