Skip to content

Commit

Permalink
Improve attribute formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed Apr 12, 2021
1 parent 3bf4c56 commit cc381dc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/mikrotik_router/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def format_attribute(attr):
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


Expand Down
4 changes: 4 additions & 0 deletions custom_components/mikrotik_router/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def format_attribute(attr):
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


Expand Down
4 changes: 4 additions & 0 deletions custom_components/mikrotik_router/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def format_attribute(attr):
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


Expand Down
4 changes: 4 additions & 0 deletions custom_components/mikrotik_router/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ def format_attribute(attr):
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


Expand Down

0 comments on commit cc381dc

Please sign in to comment.