Skip to content

Commit

Permalink
Merge pull request #122 from tago-io/SRV-320_Geofence_Action
Browse files Browse the repository at this point in the history
SRV-320 Create new Action type 'Geofence'
  • Loading branch information
FabianoEger authored Oct 15, 2024
2 parents f392772 + 2e3b4a6 commit 470918d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/modules/Resources/actions.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { GenericID, Conditionals, TagsObj, Query, ExpireTimeOption } from "../../common/common.types";

type ActionType = "condition" | "resource" | "interval" | "schedule" | "mqtt_topic" | "usage_alert";
type ActionType =
| "condition"
| "resource"
| "interval"
| "schedule"
| "mqtt_topic"
| "usage_alert"
| "condition_geofence";
type TriggerGeofenceValueType = {
center?: number[]; // [longitude, latitude]
radius?: number;
coordinates?: number[][]; // [[longitude, latitude], [longitude, latitude], ...]
};

type ActionTypeParams =
| {
Expand Down Expand Up @@ -83,6 +95,13 @@ type ActionTriggerType =
| "am";
condition: "=" | ">";
condition_value: number;
}
| {
device: string;
variable: string;
is: "IN" | "OUT";
value: TriggerGeofenceValueType;
unlock?: boolean;
};

interface ActionCreateInfo {
Expand Down

0 comments on commit 470918d

Please sign in to comment.