mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-16 04:14:31 +02:00
Revert "fixed possible issue in environment sensor"
This reverts commit 5af80f97
This commit is contained in:
parent
5af80f979e
commit
5a2df12ced
1 changed files with 2 additions and 8 deletions
|
@ -144,12 +144,6 @@ SENSOR_TYPES = {
|
||||||
ATTR_PATH: "accounting",
|
ATTR_PATH: "accounting",
|
||||||
ATTR_ATTR: "wan-rx",
|
ATTR_ATTR: "wan-rx",
|
||||||
},
|
},
|
||||||
"environment": {
|
|
||||||
ATTR_DEVICE_CLASS: None,
|
|
||||||
ATTR_ICON: "mdi:clipboard-list",
|
|
||||||
ATTR_PATH: "environment",
|
|
||||||
ATTR_ATTR: "name",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_ATTRIBUTES_ACCOUNTING = ["address", "mac-address", "host-name"]
|
DEVICE_ATTRIBUTES_ACCOUNTING = ["address", "mac-address", "host-name"]
|
||||||
|
@ -247,7 +241,7 @@ def update_items(inst, config_entry, mikrotik_controller, async_add_entities, se
|
||||||
|
|
||||||
for uid in mikrotik_controller.data["environment"]:
|
for uid in mikrotik_controller.data["environment"]:
|
||||||
item_id = (
|
item_id = (
|
||||||
f"{inst}-environment-{mikrotik_controller.data['environment'][uid]['name']}"
|
f"{inst}-{sensor}-{mikrotik_controller.data['environment'][uid]['name']}"
|
||||||
)
|
)
|
||||||
_LOGGER.debug("Updating sensor %s", item_id)
|
_LOGGER.debug("Updating sensor %s", item_id)
|
||||||
if item_id in sensors:
|
if item_id in sensors:
|
||||||
|
@ -258,7 +252,7 @@ def update_items(inst, config_entry, mikrotik_controller, async_add_entities, se
|
||||||
sensors[item_id] = MikrotikControllerEnvironmentSensor(
|
sensors[item_id] = MikrotikControllerEnvironmentSensor(
|
||||||
mikrotik_controller=mikrotik_controller,
|
mikrotik_controller=mikrotik_controller,
|
||||||
inst=inst,
|
inst=inst,
|
||||||
sensor="environment",
|
sensor=sensor,
|
||||||
uid=uid,
|
uid=uid,
|
||||||
)
|
)
|
||||||
new_sensors.append(sensors[item_id])
|
new_sensors.append(sensors[item_id])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue