Skip to content

Commit fc42259

Browse files
committed
Use cast() to fix mypy-error
1 parent 99466b1 commit fc42259

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugwise/helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import asyncio
88
import datetime as dt
9+
from typing import cast
910

1011
# This way of importing aiohttp is because of patch/mocking in testing (aiohttp timeouts)
1112
from aiohttp import BasicAuth, ClientError, ClientResponse, ClientSession, ClientTimeout
@@ -1492,7 +1493,7 @@ def _update_device_with_dicts(
14921493
Move relevant data into dicts of binary_sensors, sensors, switches,
14931494
and add these to the output.
14941495
"""
1495-
device_out: DeviceData = {}
1496+
device_out: DeviceDataPoints = {}
14961497
for d_key, d_value in device_in.items():
14971498
device_out.update({d_key: d_value}) # type: ignore [misc]
14981499
for key, value in list(data.items()):
@@ -1518,6 +1519,7 @@ def _update_device_with_dicts(
15181519
):
15191520
bs_dict["plugwise_notification"] = False
15201521

1522+
data = cast(DeviceData, data)
15211523
device_out.update(data)
15221524
if bs_dict:
15231525
device_out["binary_sensors"] = bs_dict

0 commit comments

Comments
 (0)