Elixir Sonos Controller Elixir "Application"
- Allows for basic control of Sonos household from Elixir/Erlang
- Discovers Sonos Devices on LAN once application is launched
alias Sonex.Discovery
alias Sonex.Player
den_player = Sonex.Discovery.playerByName("Den")
portable = Sonex.Discovery.playerByName("Portable")
den_player |> Sonex.Discovery.zone_group_state()
portable |> Player.zone_group_state()
portable |> Player.group(:leave)
portable |> Player.control(:pause)
portable |> Player.audio(:volume)
portable |> Player.audio(:volume, 50)
den_player |> Player.control(:pause)
den_player |> Player.position_info()
On Linux
sudo apt-get install erlang-xmerl
If available in Hex, the package can be installed as:
-
Add sonex to your list of dependencies in
mix.exs
:def deps do [{:sonex, "~> 0.0.1"}] end
-
Ensure sonex is started before your application:
def application do [applications: [:sonex]] end