Skip to content

Commit

Permalink
Add network speed values on first empty run (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaskivskyi authored Oct 31, 2023
1 parent 31ffd39 commit dca869c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion asusrouter/asusrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,14 @@ def _transform_data(self, datatype: AsusData, data: Any) -> Any:
if not "dualwan" in _services:
return data

# Add usb network if not available
network = data.copy()
# Add speed if not available - fix first empty value round
for interface in network:
for speed in ("rx_speed", "tx_speed"):
if not speed in network[interface]:
network[interface][speed] = 0.0

# Add usb network if not available
if not "usb" in network:
# Check history
history = self._state.get(AsusData.NETWORK)
Expand Down

0 comments on commit dca869c

Please sign in to comment.