@@ -50,8 +50,9 @@ async def async_get_devices(self) -> List[Device]:
50
50
if self .token is None :
51
51
await self .async_initialize_token ()
52
52
53
- raw = await self ._async_ws_function (CMD_DEVICES )
54
53
self .devices .clear ()
54
+ raw = await self ._async_ws_function (CMD_DEVICES )
55
+
55
56
try :
56
57
xml_root = element_tree .fromstring (raw )
57
58
mac_adresses : List [str ] = [mac .text for mac in xml_root .iter ("MACAddr" )]
@@ -71,15 +72,14 @@ async def async_get_devices(self) -> List[Device]:
71
72
72
73
async def async_get_downstream (self ):
73
74
"""Get the current downstream cable modem state."""
74
-
75
75
if self .token is None :
76
76
await self .async_initialize_token ()
77
77
78
+ self .ds_channels .clear ()
78
79
raw = await self ._async_ws_function (CMD_DOWNSTREAM )
79
80
80
81
try :
81
82
xml_root = element_tree .fromstring (raw )
82
- self .ds_channels .clear ()
83
83
for downstream in xml_root .iter ("downstream" ):
84
84
self .ds_channels .append (
85
85
DownstreamChannel (
@@ -102,15 +102,14 @@ async def async_get_downstream(self):
102
102
103
103
async def async_get_upstream (self ):
104
104
"""Get the current upstream cable modem state."""
105
-
106
105
if self .token is None :
107
106
await self .async_initialize_token ()
108
107
108
+ self .us_channels .clear ()
109
109
raw = await self ._async_ws_function (CMD_UPSTREAM )
110
110
111
111
try :
112
112
xml_root = element_tree .fromstring (raw )
113
- self .us_channels .clear ()
114
113
for upstream in xml_root .iter ("upstream" ):
115
114
self .us_channels .append (
116
115
UpstreamChannel (
0 commit comments