mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-28 19:50:06 +02:00
renamed format_attribute to helper.py
This commit is contained in:
parent
1ea1f3a4b7
commit
a3e6761c78
6 changed files with 27 additions and 95 deletions
17
custom_components/mikrotik_router/helper.py
Normal file
17
custom_components/mikrotik_router/helper.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
"""Helper functions for Mikrotik Router."""
|
||||
|
||||
|
||||
# ---------------------------
|
||||
# format_attribute
|
||||
# ---------------------------
|
||||
def format_attribute(attr):
|
||||
res = attr.replace("-", " ")
|
||||
res = res.capitalize()
|
||||
res = res.replace(" ip ", " IP ")
|
||||
res = res.replace(" mac ", " MAC ")
|
||||
res = res.replace(" mtu", " MTU")
|
||||
res = res.replace("Sfp", "SFP")
|
||||
res = res.replace("Poe", "POE")
|
||||
res = res.replace(" tx", " TX")
|
||||
res = res.replace(" rx", " RX")
|
||||
return res
|
Loading…
Add table
Add a link
Reference in a new issue