Search in sources :

Example 1 with GeofenceDefinition

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);
}
Also used : AttributeRef(org.openremote.model.attribute.AttributeRef) GeofenceDefinition(org.openremote.model.rules.geofence.GeofenceDefinition)

Aggregations

AttributeRef (org.openremote.model.attribute.AttributeRef)1 GeofenceDefinition (org.openremote.model.rules.geofence.GeofenceDefinition)1