Skip to content

Commit 289b6d4

Browse files
committed
Add testcase for Anna dhw and userdata
1 parent 14abd80 commit 289b6d4

File tree

6 files changed

+2887
-0
lines changed

6 files changed

+2887
-0
lines changed

tests/test_smile.py

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,102 @@ async def test_connect_anna_v4(self):
939939
await smile.close_connection()
940940
await self.disconnect(server, client)
941941

942+
@pytest.mark.asyncio
943+
async def test_connect_anna_v4_dhw(self):
944+
"""Test an Anna firmware 4 setup without a boiler."""
945+
testdata = {
946+
# Anna
947+
"01b85360fdd243d0aaad4d6ac2a5ba7e": {
948+
"class": "thermostat",
949+
"fw": "2018-02-08T11:15:53+01:00",
950+
"location": "eb5309212bf5407bb143e5bfa3b18aee",
951+
"model": "Anna",
952+
"name": "Anna",
953+
"vendor": "Plugwise",
954+
"preset_modes": ["vacation", "no_frost", "away", "asleep", "home"],
955+
"active_preset": "home",
956+
"presets": {
957+
"vacation": [15.0, 28.0],
958+
"no_frost": [10.0, 30.0],
959+
"away": [17.5, 25.0],
960+
"asleep": [17.0, 24.0],
961+
"home": [20.5, 22.0],
962+
},
963+
"available_schedules": ["Standaard", "Thuiswerken"],
964+
"selected_schedule": "None",
965+
"schedule_temperature": 20.5,
966+
"last_used": "Standaard",
967+
"mode": "heat",
968+
"sensors": {"temperature": 20.5, "setpoint": 20.5, "illuminance": 40.5},
969+
},
970+
# Central
971+
"cd0e6156b1f04d5f952349ffbe397481": {
972+
"class": "heater_central",
973+
"fw": None,
974+
"location": "94c107dc6ac84ed98e9f68c0dd06bf71",
975+
"model": "2.32",
976+
"name": "OpenTherm",
977+
"vendor": "Bosch Thermotechniek B.V.",
978+
"binary_sensors": {
979+
"dhw_state": True,
980+
"flame_state": True,
981+
"heating_state": False,
982+
},
983+
"sensors": {
984+
"water_temperature": 52.0,
985+
"intended_boiler_temperature": 48.6,
986+
"modulation_level": 0.0,
987+
"return_temperature": 42.0,
988+
"water_pressure": 2.1,
989+
},
990+
"switches": {"dhw_cm_switch": False},
991+
},
992+
# Gateway
993+
"0466eae8520144c78afb29628384edeb": {
994+
"class": "gateway",
995+
"fw": "4.0.15",
996+
"location": "94c107dc6ac84ed98e9f68c0dd06bf71",
997+
"model": "Anna",
998+
"name": "Anna",
999+
"vendor": "Plugwise B.V.",
1000+
"binary_sensors": {"plugwise_notification": False},
1001+
"sensors": {"outdoor_temperature": 7.44},
1002+
},
1003+
}
1004+
1005+
self.smile_setup = "anna_v4_dhw"
1006+
server, smile, client = await self.connect_wrapper()
1007+
assert smile.smile_hostname == "smile000000"
1008+
1009+
_LOGGER.info("Basics:")
1010+
_LOGGER.info(" # Assert type = thermostat")
1011+
assert smile.smile_type == "thermostat"
1012+
_LOGGER.info(" # Assert version")
1013+
assert smile.smile_version[0] == "4.0.15"
1014+
_LOGGER.info(" # Assert no legacy")
1015+
assert not smile._smile_legacy
1016+
1017+
await self.device_test(smile, testdata)
1018+
assert not self.notifications
1019+
1020+
await self.tinker_thermostat(
1021+
smile,
1022+
"eb5309212bf5407bb143e5bfa3b18aee",
1023+
good_schemas=["Standaard", "Thuiswerken"],
1024+
)
1025+
await smile.close_connection()
1026+
await self.disconnect(server, client)
1027+
1028+
server, smile, client = await self.connect_wrapper(raise_timeout=True)
1029+
await self.tinker_thermostat(
1030+
smile,
1031+
"eb5309212bf5407bb143e5bfa3b18aee",
1032+
good_schemas=["Standaard", "Thuiswerken"],
1033+
unhappy=True,
1034+
)
1035+
await smile.close_connection()
1036+
await self.disconnect(server, client)
1037+
9421038
@pytest.mark.asyncio
9431039
async def test_connect_anna_v4_no_tag(self):
9441040
"""Test an Anna firmware 4 setup without a boiler - no presets."""

0 commit comments

Comments
 (0)