getPropertyByDeviceParameter static method
Implementation
static Property? getPropertyByDeviceParameter(
String parameter, DeviceIot? device) {
String nodeId = getNodeIdFromParameter(parameter);
if (device != null) {
Node? node = device.nodes.singleWhereOrNull((node) => node.id == nodeId);
if (node != null) {
return node.properties.singleWhereOrNull(
(prop) => prop.id == getResourceNameFromDeviceParameter(parameter));
}
}
return null;
}