Skip to content

Commit f65df5a

Browse files
authored
Merge pull request #172 from plugwise/heater_electric
Include `heater_electric` plug-type, in new constant `SPECIAL_PLUG_TYPES`
2 parents d14bc2a + aa47881 commit f65df5a

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 6
7+
CACHE_VERSION: 7
88
DEFAULT_PYTHON: "3.9"
99
PRE_COMMIT_HOME: ~/.cache/pre-commit
1010

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ repos:
3333
- id: pyupgrade
3434
args: [--py37-plus]
3535
- repo: https://github.com/psf/black
36-
rev: 22.1.0
36+
rev: 22.3.0
3737
hooks:
3838
- id: black
3939
args:

CHANGELOG.md

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

3+
# v0.17.3 - Smile Adam: add support for heater_electric type Plugs
4+
35
# v0.17.2 - Smile Adam: more bugfixes, improvementds
46
- Bugfix: update set_schedule_state() to handle multi thermostat scenario's
57
- Improve tracking of the last used schedule, needed due to the changes in set_schedule_state()

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.17.2"
3+
__version__ = "0.17.3"
44

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

plugwise/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,11 @@
384384
"zone_thermostat",
385385
"thermostatic_radiator_valve",
386386
]
387+
SPECIAL_PLUG_TYPES: Final[list[str]] = [
388+
"central_heating_pump",
389+
"valve_actuator",
390+
"heater_electric",
391+
]
387392

388393
# XML data paths
389394
APPLIANCES: Final = "/core/appliances"

plugwise/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
LOGGER,
4040
POWER_WATT,
4141
SENSORS,
42+
SPECIAL_PLUG_TYPES,
4243
SWITCH_GROUP_TYPES,
4344
SWITCHES,
4445
THERMOSTAT_CLASSES,
@@ -1271,7 +1272,7 @@ def _get_lock_state(self, xml: str) -> dict[str, Any]:
12711272
actuator = "actuators"
12721273
func_type = "relay"
12731274
appl_class = xml.find("type").text
1274-
if appl_class not in ["central_heating_pump", "valve_actuator"]:
1275+
if appl_class not in SPECIAL_PLUG_TYPES:
12751276
locator = f"./{actuator}/{func_type}/lock"
12761277
if (found := xml.find(locator)) is not None:
12771278
data["lock"] = format_measure(found.text, None)

0 commit comments

Comments
 (0)