Skip to content

Commit 0377e40

Browse files
authored
Merge pull request #164 from plugwise/anna_bug_heating_state
Improve guarding
2 parents 08e965b + bc34f67 commit 0377e40

File tree

9 files changed

+2894
-3
lines changed

9 files changed

+2894
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
# v0.16.9a0 - Smile: bugfix
4+
- Fix for https://github.com/plugwise/plugwise-beta/issues/250
5+
36
# v0.16.8 - Smile: bugfixes, continued
47
- Fix for https://github.com/home-assistant/core/issues/68003
58
- Refix solution for #158

plugwise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Plugwise module."""
22

3-
__version__ = "0.16.8"
3+
__version__ = "0.16.9a0"
44

55
from plugwise.smile import Smile
66
from plugwise.stick import Stick

plugwise/helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,10 @@ def _get_appliance_data(self, d_id: str) -> dict[str, Any]:
875875
data = self._appliance_measurements(appliance, data, measurements)
876876
data.update(self._get_lock_state(appliance))
877877

878-
# Elga doesn't use intended_cental_heating_state to show the generic heating state
878+
# Remove c_heating_state from the output
879+
# Also, Elga doesn't use intended_cental_heating_state to show the generic heating state
879880
if "c_heating_state" in data:
880-
if "heating_state" in data:
881+
if self._anna_cooling_present and "heating_state" in data:
881882
if data.get("c_heating_state") and not data.get("heating_state"):
882883
data["heating_state"] = True
883884
data.pop("c_heating_state")

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)