feat: expose CRUD, onboarding, pubsub via web

This commit is contained in:
2026-04-22 16:32:41 +02:00
parent 9807331da4
commit 9389c32244
33 changed files with 1536 additions and 7 deletions
+6
View File
@@ -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)