mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-24 12:34:31 +02:00
Another try to pass Black :D
This commit is contained in:
parent
bade52165c
commit
bbc3124527
1 changed files with 11 additions and 7 deletions
|
@ -1183,14 +1183,18 @@ class MikrotikControllerData:
|
||||||
entry_count = len(accounting_data)
|
entry_count = len(accounting_data)
|
||||||
|
|
||||||
if entry_count is threshold:
|
if entry_count is threshold:
|
||||||
_LOGGER.warning(f"Accounting entries count reached the threshold of {threshold}!"
|
_LOGGER.warning(
|
||||||
" Some entries were not saved by Mikrotik so accounting calculation won't be correct."
|
f"Accounting entries count reached the threshold of {threshold}!"
|
||||||
" Consider shortening update interval or"
|
" Some entries were not saved by Mikrotik so accounting calculation won't be correct."
|
||||||
" increasing the accounting threshold value in Mikrotik.")
|
" Consider shortening update interval or"
|
||||||
|
" increasing the accounting threshold value in Mikrotik."
|
||||||
|
)
|
||||||
elif entry_count > threshold * 0.9:
|
elif entry_count > threshold * 0.9:
|
||||||
_LOGGER.info(f"Accounting entries count ({entry_count} reached 90% of the threshold,"
|
_LOGGER.info(
|
||||||
f" currently set to {threshold}! Consider shortening update interval or"
|
f"Accounting entries count ({entry_count} reached 90% of the threshold,"
|
||||||
" increasing the accounting threshold value in Mikrotik.")
|
f" currently set to {threshold}! Consider shortening update interval or"
|
||||||
|
" increasing the accounting threshold value in Mikrotik."
|
||||||
|
)
|
||||||
|
|
||||||
for item in accounting_data.values():
|
for item in accounting_data.values():
|
||||||
source_ip = str(item.get("src-address")).strip()
|
source_ip = str(item.get("src-address")).strip()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue