Skip to content

Commit bee220b

Browse files
committed
Save adam with emma userdata, add testcase
1 parent ca34ffa commit bee220b

File tree

4 files changed

+2791
-0
lines changed

4 files changed

+2791
-0
lines changed

fixtures/adam_anna_new_2/data.json

Lines changed: 328 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
{
2+
"056ee145a816487eaa69243c3280f8bf": {
3+
"available": true,
4+
"binary_sensors": {
5+
"dhw_state": false,
6+
"flame_state": false,
7+
"heating_state": false
8+
},
9+
"dev_class": "heater_central",
10+
"location": "bc93488efab249e5bc54fd7e175a6f91",
11+
"maximum_boiler_temperature": {
12+
"lower_bound": 25.0,
13+
"resolution": 0.01,
14+
"setpoint": 50.0,
15+
"upper_bound": 95.0
16+
},
17+
"model": "Generic heater",
18+
"name": "OpenTherm",
19+
"sensors": {
20+
"intended_boiler_temperature": 0.0,
21+
"water_temperature": 34.0
22+
},
23+
"switches": {
24+
"dhw_cm_switch": false
25+
}
26+
},
27+
"14df5c4dc8cb4ba69f9d1ac0eaf7c5c6": {
28+
"available": true,
29+
"dev_class": "zone_thermostat",
30+
"hardware": "1",
31+
"location": "f2bf9048bef64cc5b6d5110154e33c81",
32+
"model_id": "170-01",
33+
"name": "Emma",
34+
"sensors": {
35+
"humidity": 61.8,
36+
"setpoint": 15.0,
37+
"temperature": 21.9
38+
},
39+
"temperature_offset": {
40+
"lower_bound": -2.0,
41+
"resolution": 0.1,
42+
"setpoint": 0.0,
43+
"upper_bound": 2.0
44+
},
45+
"vendor": "Plugwise",
46+
"zigbee_mac_address": "60EFABFFFE89965C"
47+
},
48+
"1772a4ea304041adb83f357b751341ff": {
49+
"available": true,
50+
"binary_sensors": {
51+
"low_battery": false
52+
},
53+
"dev_class": "thermostatic_radiator_valve",
54+
"firmware": "2020-11-04T01:00:00+01:00",
55+
"hardware": "1",
56+
"location": "f871b8c4d63549319221e294e4f88074",
57+
"model": "Tom/Floor",
58+
"model_id": "106-03",
59+
"name": "Tom Badkamer",
60+
"sensors": {
61+
"battery": 60,
62+
"setpoint": 12.0,
63+
"temperature": 19.1,
64+
"temperature_difference": -0.4,
65+
"valve_position": 0.0
66+
},
67+
"temperature_offset": {
68+
"lower_bound": -2.0,
69+
"resolution": 0.1,
70+
"setpoint": 0.1,
71+
"upper_bound": 2.0
72+
},
73+
"vendor": "Plugwise",
74+
"zigbee_mac_address": "000D6F000C8FF5EE"
75+
},
76+
"2568cc4b9c1e401495d4741a5f89bee1": {
77+
"available": true,
78+
"dev_class": "hometheater_plug",
79+
"firmware": "2020-11-10T01:00:00+01:00",
80+
"location": "f2bf9048bef64cc5b6d5110154e33c81",
81+
"model": "Plug",
82+
"model_id": "160-01",
83+
"name": "Plug MediaTV",
84+
"sensors": {
85+
"electricity_consumed": 15.6,
86+
"electricity_consumed_interval": 4.0,
87+
"electricity_produced": 0.0,
88+
"electricity_produced_interval": 0.0
89+
},
90+
"switches": {
91+
"lock": false,
92+
"relay": true
93+
},
94+
"vendor": "Plugwise",
95+
"zigbee_mac_address": "000D6F000D13CCFD"
96+
},
97+
"29542b2b6a6a4169acecc15c72a599b8": {
98+
"available": true,
99+
"dev_class": "water_heater_vessel_plug",
100+
"firmware": "2020-11-10T01:00:00+01:00",
101+
"location": "8201a2ac4d1b4303bf994e18d67311eb",
102+
"model": "Plug",
103+
"model_id": "160-01",
104+
"name": "Plug Thermex Boiler",
105+
"sensors": {
106+
"electricity_consumed": 0.69,
107+
"electricity_consumed_interval": 0.0,
108+
"electricity_produced": 0.0,
109+
"electricity_produced_interval": 0.0
110+
},
111+
"switches": {
112+
"lock": true,
113+
"relay": true
114+
},
115+
"vendor": "Plugwise",
116+
"zigbee_mac_address": "000D6F000D13CA9A"
117+
},
118+
"854f8a9b0e7e425db97f1f110e1ce4b3": {
119+
"available": true,
120+
"dev_class": "central_heating_pump_plug",
121+
"firmware": "2020-11-10T01:00:00+01:00",
122+
"location": "f2bf9048bef64cc5b6d5110154e33c81",
123+
"model": "Plug",
124+
"model_id": "160-01",
125+
"name": "Plug Vloerverwarming",
126+
"sensors": {
127+
"electricity_consumed": 0.0,
128+
"electricity_consumed_interval": 0.0,
129+
"electricity_produced": 0.0,
130+
"electricity_produced_interval": 0.0
131+
},
132+
"switches": {
133+
"relay": false
134+
},
135+
"vendor": "Plugwise",
136+
"zigbee_mac_address": "000D6F000D13CB6F"
137+
},
138+
"ad4838d7d35c4d6ea796ee12ae5aedf8": {
139+
"dev_class": "thermostat",
140+
"location": "f2bf9048bef64cc5b6d5110154e33c81",
141+
"model": "ThermoTouch",
142+
"model_id": "143.1",
143+
"name": "Anna",
144+
"sensors": {
145+
"setpoint": 15.0,
146+
"temperature": 19.5
147+
},
148+
"vendor": "Plugwise"
149+
},
150+
"da224107914542988a88561b4452b0f6": {
151+
"binary_sensors": {
152+
"plugwise_notification": false
153+
},
154+
"dev_class": "gateway",
155+
"firmware": "3.9.0",
156+
"gateway_modes": [
157+
"away",
158+
"full",
159+
"vacation"
160+
],
161+
"hardware": "AME Smile 2.0 board",
162+
"location": "bc93488efab249e5bc54fd7e175a6f91",
163+
"mac_address": "D40FB2019891",
164+
"model": "Gateway",
165+
"model_id": "smile_open_therm",
166+
"name": "Adam",
167+
"notifications": {},
168+
"regulation_modes": [
169+
"bleeding_cold",
170+
"heating",
171+
"off",
172+
"bleeding_hot"
173+
],
174+
"select_gateway_mode": "full",
175+
"select_regulation_mode": "heating",
176+
"sensors": {
177+
"outdoor_temperature": 13.9
178+
},
179+
"vendor": "Plugwise",
180+
"zigbee_mac_address": "000D6F000D5A168D"
181+
},
182+
"da575e9e09b947e281fb6e3ebce3b174": {
183+
"available": true,
184+
"binary_sensors": {
185+
"low_battery": false
186+
},
187+
"dev_class": "zone_thermometer",
188+
"firmware": "2020-09-01T02:00:00+02:00",
189+
"hardware": "1",
190+
"location": "f2bf9048bef64cc5b6d5110154e33c81",
191+
"model": "Jip",
192+
"model_id": "168-01",
193+
"name": "Jip",
194+
"sensors": {
195+
"battery": 100,
196+
"humidity": 63.9,
197+
"setpoint": 15.0,
198+
"temperature": 18.8
199+
},
200+
"vendor": "Plugwise",
201+
"zigbee_mac_address": "70AC08FFFEE16437"
202+
},
203+
"e2f4322d57924fa090fbbc48b3a140dc": {
204+
"available": true,
205+
"binary_sensors": {
206+
"low_battery": false
207+
},
208+
"dev_class": "zone_thermostat",
209+
"firmware": "2016-10-10T02:00:00+02:00",
210+
"hardware": "255",
211+
"location": "f871b8c4d63549319221e294e4f88074",
212+
"model": "Lisa",
213+
"model_id": "158-01",
214+
"name": "Lisa Badkamer",
215+
"sensors": {
216+
"battery": 71,
217+
"setpoint": 12.0,
218+
"temperature": 18.8
219+
},
220+
"temperature_offset": {
221+
"lower_bound": -2.0,
222+
"resolution": 0.1,
223+
"setpoint": 0.0,
224+
"upper_bound": 2.0
225+
},
226+
"vendor": "Plugwise",
227+
"zigbee_mac_address": "000D6F000C869B61"
228+
},
229+
"e8ef2a01ed3b4139a53bf749204fe6b4": {
230+
"dev_class": "switching",
231+
"members": [
232+
"2568cc4b9c1e401495d4741a5f89bee1",
233+
"29542b2b6a6a4169acecc15c72a599b8"
234+
],
235+
"model": "Switchgroup",
236+
"name": "Test",
237+
"switches": {
238+
"relay": true
239+
},
240+
"vendor": "Plugwise"
241+
},
242+
"f2bf9048bef64cc5b6d5110154e33c81": {
243+
"active_preset": "vacation",
244+
"available_schedules": [
245+
"Badkamer",
246+
"Vakantie",
247+
"Weekschema",
248+
"Test",
249+
"off"
250+
],
251+
"climate_mode": "heat",
252+
"control_state": "idle",
253+
"dev_class": "climate",
254+
"model": "ThermoZone",
255+
"name": "Living room",
256+
"preset_modes": [
257+
"vacation",
258+
"no_frost",
259+
"asleep",
260+
"home",
261+
"away"
262+
],
263+
"select_schedule": "off",
264+
"sensors": {
265+
"electricity_consumed": 15.6,
266+
"electricity_produced": 0.0,
267+
"temperature": 18.8
268+
},
269+
"thermostat": {
270+
"lower_bound": 1.0,
271+
"resolution": 0.01,
272+
"setpoint": 15.0,
273+
"upper_bound": 35.0
274+
},
275+
"thermostats": {
276+
"primary": [
277+
"ad4838d7d35c4d6ea796ee12ae5aedf8",
278+
"14df5c4dc8cb4ba69f9d1ac0eaf7c5c6",
279+
"da575e9e09b947e281fb6e3ebce3b174"
280+
],
281+
"secondary": []
282+
},
283+
"vendor": "Plugwise"
284+
},
285+
"f871b8c4d63549319221e294e4f88074": {
286+
"active_preset": "vacation",
287+
"available_schedules": [
288+
"Badkamer",
289+
"Vakantie",
290+
"Weekschema",
291+
"Test",
292+
"off"
293+
],
294+
"climate_mode": "heat",
295+
"control_state": "idle",
296+
"dev_class": "climate",
297+
"model": "ThermoZone",
298+
"name": "Bathroom",
299+
"preset_modes": [
300+
"vacation",
301+
"no_frost",
302+
"asleep",
303+
"home",
304+
"away"
305+
],
306+
"select_schedule": "off",
307+
"sensors": {
308+
"electricity_consumed": 0.0,
309+
"electricity_produced": 0.0,
310+
"temperature": 18.8
311+
},
312+
"thermostat": {
313+
"lower_bound": 0.0,
314+
"resolution": 0.01,
315+
"setpoint": 12.0,
316+
"upper_bound": 99.9
317+
},
318+
"thermostats": {
319+
"primary": [
320+
"e2f4322d57924fa090fbbc48b3a140dc"
321+
],
322+
"secondary": [
323+
"1772a4ea304041adb83f357b751341ff"
324+
]
325+
},
326+
"vendor": "Plugwise"
327+
}
328+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"devices": {}
3+
}

tests/test_adam.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,27 @@ async def test_connect_adam_plus_anna_new(self):
181181
await api.close_connection()
182182
await self.disconnect(server, client)
183183

184+
@pytest.mark.asyncio
185+
async def test_connect_adam_anna_new_2(self):
186+
"""Test extended Adam (firmware 3.9) with Emma setup."""
187+
self.smile_setup = "adam_anna_new_2"
188+
189+
testdata = await self.load_testdata(SMILE_TYPE, self.smile_setup)
190+
server, api, client = await self.connect_wrapper()
191+
assert api.smile.hostname == "smile000000"
192+
193+
self.validate_test_basics(
194+
_LOGGER,
195+
api,
196+
smile_type=None,
197+
smile_version="3.9.0",
198+
)
199+
200+
await self.device_test(api, "2025-10-12 00:00:01", testdata)
201+
202+
await api.close_connection()
203+
await self.disconnect(server, client)
204+
184205
@pytest.mark.asyncio
185206
async def test_connect_adam_plus_anna_new_regulation_off(self):
186207
"""Test regultaion_mode off with control_state key missing for Adam."""

0 commit comments

Comments
 (0)