Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
364 B
5
Indexable
Never
def remove_matching_modbus_entry(devices, new_entry_ip):
    # Iterate over the devices list
    for device in devices[:]:  
        if isinstance(device, ModbusEntry) and device.ip_address == new_entry_ip:
            # Remove the matching ModbusEntry from the devices list
            devices.remove(device)


remove_matching_modbus_entry(devices, new_entry_ip)
Leave a Comment