mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-21 00:25:48 +02:00
23 lines
584 B
Python
23 lines
584 B
Python
"""Helper functions for Mikrotik Router."""
|
|
|
|
|
|
# ---------------------------
|
|
# format_attribute
|
|
# ---------------------------
|
|
def format_attribute(attr):
|
|
res = attr.replace("-", "_")
|
|
res = res.replace(" ", "_")
|
|
res = res.lower()
|
|
return res
|
|
|
|
|
|
# ---------------------------
|
|
# format_value
|
|
# ---------------------------
|
|
def format_value(res):
|
|
res = res.replace("dhcp", "DHCP")
|
|
res = res.replace("dns", "DNS")
|
|
res = res.replace("capsman", "CAPsMAN")
|
|
res = res.replace("wireless", "Wireless")
|
|
res = res.replace("restored", "Restored")
|
|
return res
|