switch mp3 to tts, add genserver to app supervisor tree that periodically checks for newly connected devices and plays their associated tts message

This commit is contained in:
2024-07-17 18:20:05 -04:00
parent 8668405143
commit a085aee5c8
18 changed files with 101 additions and 200 deletions

View File

@@ -8,7 +8,7 @@ defmodule HereIAm.DevicesTest do
import HereIAm.DevicesFixtures
@invalid_attrs %{ip_address: nil, audio: nil}
@invalid_attrs %{ip_address: nil, tts: nil}
test "list_devices/0 returns all devices" do
device = device_fixture()
@@ -21,11 +21,11 @@ defmodule HereIAm.DevicesTest do
end
test "create_device/1 with valid data creates a device" do
valid_attrs = %{ip_address: "some ip_address", audio: "some audio"}
valid_attrs = %{ip_address: "some ip_address", tts: "some tts"}
assert {:ok, %Device{} = device} = Devices.create_device(valid_attrs)
assert device.ip_address == "some ip_address"
assert device.audio == "some audio"
assert device.tts == "some tts"
end
test "create_device/1 with invalid data returns error changeset" do
@@ -34,11 +34,11 @@ defmodule HereIAm.DevicesTest do
test "update_device/2 with valid data updates the device" do
device = device_fixture()
update_attrs = %{ip_address: "some updated ip_address", audio: "some updated audio"}
update_attrs = %{ip_address: "some updated ip_address", tts: "some updated tts"}
assert {:ok, %Device{} = device} = Devices.update_device(device, update_attrs)
assert device.ip_address == "some updated ip_address"
assert device.audio == "some updated audio"
assert device.tts == "some updated tts"
end
test "update_device/2 with invalid data returns error changeset" do