delete method

void delete(
  1. String device, [
  2. String? property
])

Deletes a property, or a whole device when property is null, and tells connected clients.

Implementation

void delete(String device, [String? property]) {
  _definitions.removeWhere(
    (key, _) => key.$1 == device && (property == null || key.$2 == property),
  );
  for (final connection in connections) {
    if (connection._wants(device, property)) {
      connection.send(DelProperty(device: device, name: property));
    }
  }
}