Skip to content

Commit 5785ebe

Browse files
committed
Mypy fix
1 parent a4754a3 commit 5785ebe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugwise/smile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from collections.abc import Awaitable, Callable
99
import datetime as dt
10-
from typing import Any
10+
from typing import Any, cast
1111

1212
from plugwise.constants import (
1313
ADAM,
@@ -24,6 +24,7 @@
2424
RULES,
2525
STATE_ON,
2626
GwEntityData,
27+
SwitchType,
2728
ThermoLoc,
2829
)
2930
from plugwise.data import SmileData
@@ -380,7 +381,8 @@ async def set_switch_state(
380381
self, appl_id: str, members: list[str] | None, model: str, state: str
381382
) -> bool:
382383
"""Set the given State of the relevant Switch."""
383-
current_state = self.gw_entities[appl_id]["switches"][model]
384+
model_type = cast(SwitchType, model)
385+
current_state = self.gw_entities[appl_id]["switches"][model_type]
384386
requested_state = state == STATE_ON
385387
switch = Munch()
386388
switch.actuator = "actuator_functionalities"

0 commit comments

Comments
 (0)