mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-10 01:14:33 +02:00
fixed formatting in sensors
This commit is contained in:
parent
afdb08e650
commit
ce77fb8085
1 changed files with 1 additions and 2 deletions
|
@ -185,7 +185,6 @@ def update_items(inst, mikrotik_controller, async_add_entities, sensors):
|
||||||
|
|
||||||
if "accounting_" in sensor:
|
if "accounting_" in sensor:
|
||||||
for uid in mikrotik_controller.data["accounting"]:
|
for uid in mikrotik_controller.data["accounting"]:
|
||||||
|
|
||||||
item_id = f"{inst}-{sensor}-{mikrotik_controller.data['accounting'][uid]['mac-address']}"
|
item_id = f"{inst}-{sensor}-{mikrotik_controller.data['accounting'][uid]['mac-address']}"
|
||||||
if item_id in sensors:
|
if item_id in sensors:
|
||||||
if sensors[item_id].enabled:
|
if sensors[item_id].enabled:
|
||||||
|
@ -366,7 +365,7 @@ class MikrotikAccountingSensor(MikrotikControllerSensor):
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name."""
|
"""Return the name."""
|
||||||
return f"{self._data['host-name']} {self._type[ATTR_LABEL]} "
|
return f"{self._data['host-name']} {self._type[ATTR_LABEL]}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue