Skip to content

Commit 43daac1

Browse files
committed
Add detection of Anna P1
1 parent 577f0f4 commit 43daac1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

plugwise/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ async def _smile_detect(
196196
self.smile.hostname = gateway.find("hostname").text
197197
self.smile.mac_address = gateway.find("mac_address").text
198198
self.smile.model_id = gateway.find("vendor_model").text
199+
if (elec_measurement := gateway.find(
200+
"gateway_environment/electricity_consumption_tariff_structure"
201+
)) and elec_measurement.text:
202+
parts = model.split("_")
203+
if len(parts) == 3:
204+
model = parts[0] + parts[1] + "_power" + parts[2]
199205
else:
200206
model = await self._smile_detect_legacy(result, dsmrmain, model)
201207

plugwise/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
ADAM: Final = "Adam"
3636
ANNA: Final = "Smile Anna"
37+
ANNA_P1: Final = "Smile Anna P1"
3738
DEFAULT_TIMEOUT: Final = 10
3839
DEFAULT_LEGACY_TIMEOUT: Final = 30
3940
DEFAULT_USERNAME: Final = "smile"
@@ -220,6 +221,7 @@
220221
"smile_thermo_v1": SMILE(THERMOSTAT, ANNA),
221222
"smile_thermo_v3": SMILE(THERMOSTAT, ANNA),
222223
"smile_thermo_v4": SMILE(THERMOSTAT, ANNA),
224+
"smile_thermo_power_v4": SMILE("thermostat_power", ANNA_P1),
223225
"stretch_v2": SMILE(STRETCH, "Stretch"),
224226
"stretch_v3": SMILE(STRETCH, "Stretch"),
225227
}

0 commit comments

Comments
 (0)