use of org.openremote.model.rules.geofence.GeofenceDefinition in project openremote by openremote.
the class ORConsoleGeofenceAssetAdapter method locationPredicateToGeofenceDefinition.
protected GeofenceDefinition locationPredicateToGeofenceDefinition(String assetId, GeofencePredicate geofencePredicate) {
RadialGeofencePredicate radialLocationPredicate = (RadialGeofencePredicate) geofencePredicate;
String id = assetId + "_" + radialLocationPredicate.hashCode();
String url = getWriteAttributeUrl(new AttributeRef(assetId, Asset.LOCATION.getName()));
return new GeofenceDefinition(id, radialLocationPredicate.getLat(), radialLocationPredicate.getLng(), radialLocationPredicate.getRadius(), WRITE_ATTRIBUTE_HTTP_METHOD, url);
}
Aggregations