feat: accept calibration readings only from a chosen tag

This commit is contained in:
2026-05-21 21:46:45 +02:00
parent eb22fbc789
commit b0d9a7dbf8
6 changed files with 164 additions and 61 deletions
@@ -23,6 +23,16 @@ defmodule Localiser.Web.Channels.CalibrationChannel do
{:noreply, socket}
end
def handle_info({:calibration_scan_reading, _sensor_id, tag_id, rssi}, socket) do
push(socket, "scan_reading", %{tag_id: tag_id, rssi: rssi})
{:noreply, socket}
end
def handle_info({:calibration_tag_set, _sensor_id, tag_id}, socket) do
push(socket, "tag_set", %{tag_id: tag_id})
{:noreply, socket}
end
def handle_info({:stage_started, _sensor_id, distance, completed_count}, socket) do
push(socket, "stage_started", %{distance: distance, completed_stages: completed_count})
{:noreply, socket}