Skip to content

Commit fe2b5ab

Browse files
committed
Add local mypy testing
1 parent 284d69b commit fe2b5ab

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

plugwise/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ class ZoneData(TypedDict, total=False):
528528

529529
dev_class: str
530530
name: str
531-
members: dict[MemberData]
531+
members: dict[str, list[str]]
532532
climate_mode: str
533533
# Extra for Adam Master Thermostats
534534
control_state: str | bool

plugwise/helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,9 @@ def _rank_thermostat(
882882
# Pre-elect new primary
883883
if thermo_matching[appl_class] > self._thermo_locs[loc_id]["primary_prio"]:
884884
# Demote former primary
885-
if (tl_primary:= self._thermo_locs[loc_id]["primary"]):
886-
self._thermo_locs[loc_id]["secondary"].append(tl_primary)
885+
if (tl_primary := self._thermo_locs[loc_id]["primary"]):
886+
self._thermo_locs[loc_id]["secondary"] = tl_primary
887+
self._thermo_locs[loc_id]["primary"] = []
887888

888889
# Crown primary
889890
self._thermo_locs[loc_id]["primary_prio"] = thermo_matching[appl_class]

scripts/tests_and_coverage.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "linting" ] ; then
4242

4343
echo "... pylint-ing ..."
4444
pylint plugwise/ tests/
45+
46+
echo "... mypy-ing ..."
47+
mypy plugwise/
4548
fi
4649

4750
# As to not generated fixtures, leaving biome to re-do them

0 commit comments

Comments
 (0)