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

@@ -4,7 +4,7 @@ defmodule HereIAm.Devices.Device do
schema "devices" do
field :ip_address, :string
field :audio, :string
field :tts, :string
timestamps(type: :utc_datetime)
end
@@ -12,7 +12,7 @@ defmodule HereIAm.Devices.Device do
@doc false
def changeset(device, attrs) do
device
|> cast(attrs, [:ip_address, :audio])
|> validate_required([:ip_address, :audio])
|> cast(attrs, [:ip_address, :tts])
|> validate_required([:ip_address, :tts])
end
end