Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions backend/lib/edgehog/devices/device/device.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,34 @@ defmodule Edgehog.Devices.Device do
paginate_relationship_with application_deployments: :relay,
ota_operations: :relay,
tags: :relay

subscriptions do
pubsub EdgehogWeb.Endpoint

subscribe :device_created do
action_types :create
end

subscribe :device_updated do
action_types :update
end

subscribe :device_connected do
actions [:from_device_connected_event]
end

subscribe :device_disconnected do
actions [:from_device_disconnected_event]
end

subscribe :device_tags_updated do
actions [:add_tags, :remove_tags]
end

subscribe :device_deleted do
action_types :destroy
end
end
end

actions do
Expand Down
Loading
Loading