feat: expose CRUD, onboarding, pubsub via web
This commit is contained in:
@@ -9,6 +9,12 @@ defmodule Localiser.Domain.Sensors do
|
||||
Repo.all(Sensor)
|
||||
end
|
||||
|
||||
def list_unplaced do
|
||||
Sensor |> where([s], is_nil(s.room_id)) |> Repo.all()
|
||||
end
|
||||
|
||||
def any_placed?, do: Repo.exists?(from s in Sensor, where: not is_nil(s.room_id))
|
||||
|
||||
def list_sensors_for_room(room_id) do
|
||||
Sensor
|
||||
|> where([s], s.room_id == ^room_id)
|
||||
|
||||
Reference in New Issue
Block a user