File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def __init__(
7676 self ._target_smile : str = NONE
7777 self .gateway_id : str = NONE
7878 self .loc_data : dict [str , ThermoLoc ] = {}
79- self .smile_fw_version : Version | None
79+ self .smile_fw_version : Version | None = None
8080 self .smile_hostname : str = NONE
8181 self .smile_hw_version : str | None = None
8282 self .smile_legacy = False
@@ -88,7 +88,7 @@ def __init__(
8888 self .smile_version : Version | None = None
8989 self .smile_zigbee_mac_address : str | None = None
9090
91- async def connect (self ) -> str | None :
91+ async def connect (self ) -> Version | None :
9292 """Connect to Plugwise device and determine its name, type and version."""
9393 result = await self ._request (DOMAIN_OBJECTS )
9494 # Work-around for Stretch fw 2.7.18
Original file line number Diff line number Diff line change 2929
3030import aiohttp
3131from munch import Munch
32+ from packaging .version import Version
3233
3334
3435class SmileLegacyAPI (SmileLegacyData ):
@@ -48,7 +49,7 @@ def __init__(
4849 _stretch_v2 : bool ,
4950 _target_smile : str ,
5051 loc_data : dict [str , ThermoLoc ],
51- smile_fw_version : str | None ,
52+ smile_fw_version : Version | None ,
5253 smile_hostname : str ,
5354 smile_hw_version : str | None ,
5455 smile_mac_address : str | None ,
Original file line number Diff line number Diff line change 3535
3636# Dict as class
3737from munch import Munch
38+ from packaging .version import Version
3839
3940
4041class SmileAPI (SmileData ):
@@ -57,7 +58,7 @@ def __init__(
5758 _schedule_old_states : dict [str , dict [str , str ]],
5859 gateway_id : str ,
5960 loc_data : dict [str , ThermoLoc ],
60- smile_fw_version : str | None ,
61+ smile_fw_version : Version | None ,
6162 smile_hostname : str | None ,
6263 smile_hw_version : str | None ,
6364 smile_mac_address : str | None ,
Original file line number Diff line number Diff line change 22"""Test Plugwise Home Assistant module and generate test JSON fixtures."""
33import importlib
44import json
5- from packaging import version
65
76# Fixture writing
87import logging
1817# Testing
1918import aiohttp
2019from freezegun import freeze_time
20+ from packaging import version
2121
2222pw_constants = importlib .import_module ("plugwise.constants" )
2323pw_exceptions = importlib .import_module ("plugwise.exceptions" )
You can’t perform that action at this time.
0 commit comments