feat: add get_version endpoint for individual sensors
This commit is contained in:
@@ -59,6 +59,11 @@ defmodule Localiser.Domain.Sensors do
|
||||
{:ok, sensor}
|
||||
end
|
||||
|
||||
def get_version(%Sensor{} = sensor) do
|
||||
Localiser.MQTT.Connection.publish(cmd_topic(sensor), Jason.encode!(%{action: "version"}))
|
||||
{:ok, sensor}
|
||||
end
|
||||
|
||||
def send_ota_update(%Sensor{} = sensor, url, version) do
|
||||
payload = %{
|
||||
action: "ota",
|
||||
|
||||
Reference in New Issue
Block a user