From 6a0b2e894ae1bc5747ab6df0475fcb1bb415041b Mon Sep 17 00:00:00 2001 From: Tomaae Date: Wed, 9 Mar 2022 10:11:03 +0100 Subject: [PATCH] removed old code --- .../mikrotik_router/binary_sensor.py | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/custom_components/mikrotik_router/binary_sensor.py b/custom_components/mikrotik_router/binary_sensor.py index 0d59c9f..9f8caf3 100644 --- a/custom_components/mikrotik_router/binary_sensor.py +++ b/custom_components/mikrotik_router/binary_sensor.py @@ -117,73 +117,6 @@ def update_items(inst, config_entry, mikrotik_controller, async_add_entities, se ) new_sensors.append(sensors[item_id]) - # - # # Add switches - # for sid, sid_uid, sid_name, sid_ref, sid_attr, sid_func in zip( - # # Data point name - # ["ppp_secret", "interface"], - # # Data point unique id - # ["name", "default-name"], - # # Entry Name - # ["name", "name"], - # # Entry Unique id - # ["name", "port-mac-address"], - # # Attr - # [None, DEVICE_ATTRIBUTES_IFACE], - # # Tracker function - # [ - # MikrotikControllerPPPSecretBinarySensor, - # MikrotikControllerPortBinarySensor, - # ], - # ): - # if ( - # sid_func == MikrotikControllerPortBinarySensor - # and not config_entry.options.get( - # CONF_SENSOR_PORT_TRACKER, DEFAULT_SENSOR_PORT_TRACKER - # ) - # ): - # continue - # for uid in mikrotik_controller.data[sid]: - # if ( - # # Skip if interface is wlan - # sid == "interface" - # and mikrotik_controller.data[sid][uid]["type"] == "wlan" - # ): - # continue - # # Update entity - # item_id = f"{inst}-{sid}-{mikrotik_controller.data[sid][uid][sid_uid]}" - # _LOGGER.debug("Updating binary_sensor %s", item_id) - # if item_id in sensors: - # if sensors[item_id].enabled: - # sensors[item_id].async_schedule_update_ha_state() - # continue - # - # # Create new entity - # sid_data = { - # "sid": sid, - # "sid_uid": sid_uid, - # "sid_name": sid_name, - # "sid_ref": sid_ref, - # "sid_attr": sid_attr, - # } - # sensors[item_id] = sid_func( - # inst, uid, mikrotik_controller, config_entry, sid_data - # ) - # new_sensors.append(sensors[item_id]) - # - # for sensor in SENSOR_TYPES: - # item_id = f"{inst}-{sensor}" - # _LOGGER.debug("Updating binary_sensor %s", item_id) - # if item_id in sensors: - # if sensors[item_id].enabled: - # sensors[item_id].async_schedule_update_ha_state() - # continue - # - # sensors[item_id] = MikrotikControllerBinarySensor( - # mikrotik_controller=mikrotik_controller, inst=inst, sid_data=sensor - # ) - # new_sensors.append(sensors[item_id]) - if new_sensors: async_add_entities(new_sensors, True)