mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 03:08:01 +02:00
Replace lists with tuples (2) (#53685)
This commit is contained in:
@ -414,20 +414,20 @@ def _update( # noqa: C901
|
||||
err.pid,
|
||||
err.name,
|
||||
)
|
||||
elif type_ in ["network_out", "network_in"]:
|
||||
elif type_ in ("network_out", "network_in"):
|
||||
counters = _net_io_counters()
|
||||
if data.argument in counters:
|
||||
counter = counters[data.argument][IO_COUNTER[type_]]
|
||||
state = round(counter / 1024 ** 2, 1)
|
||||
else:
|
||||
state = None
|
||||
elif type_ in ["packets_out", "packets_in"]:
|
||||
elif type_ in ("packets_out", "packets_in"):
|
||||
counters = _net_io_counters()
|
||||
if data.argument in counters:
|
||||
state = counters[data.argument][IO_COUNTER[type_]]
|
||||
else:
|
||||
state = None
|
||||
elif type_ in ["throughput_network_out", "throughput_network_in"]:
|
||||
elif type_ in ("throughput_network_out", "throughput_network_in"):
|
||||
counters = _net_io_counters()
|
||||
if data.argument in counters:
|
||||
counter = counters[data.argument][IO_COUNTER[type_]]
|
||||
@ -445,7 +445,7 @@ def _update( # noqa: C901
|
||||
value = counter
|
||||
else:
|
||||
state = None
|
||||
elif type_ in ["ipv4_address", "ipv6_address"]:
|
||||
elif type_ in ("ipv4_address", "ipv6_address"):
|
||||
addresses = _net_if_addrs()
|
||||
if data.argument in addresses:
|
||||
for addr in addresses[data.argument]:
|
||||
|
Reference in New Issue
Block a user