View Source ExshomeTest.TestMpvServer (Exshome - Elixir Smart Home v0.1.7)

Test MPV server. You can use it to emulate an MPV server.

Link to this section Summary

Link to this section Types

@type response_fn() :: (request_id :: String.t(), data :: map() -> map())

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

default_response_handler(request_id, arg2, state)

View Source
@spec default_response_handler(
  request_id :: String.t(),
  request_data :: map(),
  state :: ExshomeTest.TestMpvServer.State.t()
) :: {:noreply, ExshomeTest.TestMpvServer.State.t()}
Link to this function

generate_random_tracks(amount \\ 1..10)

View Source
@spec generate_random_tracks(Range.t()) :: :ok
@spec last_received_message() :: map()
@spec playlist() :: [String.t()]
@spec received_messages() :: [map()]
Link to this function

received_messages(server)

View Source
@spec received_messages(pid()) :: [map()]
@spec send_event(map()) :: map()
Link to this function

send_event(server, event)

View Source
@spec send_event(server :: pid(), event :: %{}) :: term()
@spec server_fixture() :: term()
Link to this function

set_response_fn(function)

View Source
@spec set_response_fn(function :: response_fn()) :: term()
Link to this function

set_response_fn(server, response_fn)

View Source
@spec set_response_fn(server :: pid(), response_fn :: response_fn()) :: term()
Link to this function

start_link(init_arguments)

View Source
@spec stop_server() :: :ok
Link to this function

wait_until_socket_connects()

View Source
Link to this function

wait_until_socket_disconnects()

View Source