Two fixes (#54102)
parent
adc9f75493
commit
582f2ae2f6
|
@ -81,12 +81,12 @@ def _retrieve_max_kb_s_received_state(status: FritzStatus, last_value: str) -> f
|
|||
|
||||
def _retrieve_gb_sent_state(status: FritzStatus, last_value: str) -> float:
|
||||
"""Return upload total data."""
|
||||
return round(status.bytes_sent * 8 / 1000 / 1000 / 1000, 1) # type: ignore[no-any-return]
|
||||
return round(status.bytes_sent / 1000 / 1000 / 1000, 1) # type: ignore[no-any-return]
|
||||
|
||||
|
||||
def _retrieve_gb_received_state(status: FritzStatus, last_value: str) -> float:
|
||||
"""Return download total data."""
|
||||
return round(status.bytes_received * 8 / 1000 / 1000 / 1000, 1) # type: ignore[no-any-return]
|
||||
return round(status.bytes_received / 1000 / 1000 / 1000, 1) # type: ignore[no-any-return]
|
||||
|
||||
|
||||
class SensorData(TypedDict, total=False):
|
||||
|
|
|
@ -13,7 +13,6 @@ from fritzconnection.core.exceptions import (
|
|||
FritzSecurityError,
|
||||
FritzServiceError,
|
||||
)
|
||||
import slugify as unicode_slug
|
||||
import xmltodict
|
||||
|
||||
from homeassistant.components.network import async_get_source_ip
|
||||
|
@ -248,10 +247,18 @@ def wifi_entities_list(
|
|||
)
|
||||
if network_info:
|
||||
ssid = network_info["NewSSID"]
|
||||
if unicode_slug.slugify(ssid, lowercase=False) in networks.values():
|
||||
_LOGGER.debug("SSID from device: <%s>", ssid)
|
||||
if (
|
||||
slugify(
|
||||
ssid,
|
||||
)
|
||||
in [slugify(v) for v in networks.values()]
|
||||
):
|
||||
_LOGGER.debug("SSID duplicated, adding suffix")
|
||||
networks[i] = f'{ssid} {std_table[network_info["NewStandard"]]}'
|
||||
else:
|
||||
networks[i] = ssid
|
||||
_LOGGER.debug("SSID normalized: <%s>", networks[i])
|
||||
|
||||
return [
|
||||
FritzBoxWifiSwitch(fritzbox_tools, device_friendly_name, net, network_name)
|
||||
|
|
Loading…
Reference in New Issue