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:
@@ -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
|
||||
|
Reference in New Issue
Block a user