mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-13 10:54:33 +02:00
Use Snake Case formatting for attribute names #204
This commit is contained in:
parent
ccb1b1fae7
commit
bc127cd16e
1 changed files with 3 additions and 9 deletions
|
@ -5,15 +5,9 @@
|
|||
# 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")
|
||||
res = attr.replace("-", "_")
|
||||
res = res.replace(" ", "_")
|
||||
res = res.lower()
|
||||
return res
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue