Skip to content

Instantly share code, notes, and snippets.

Created Sep 13, 2017
What would you like to do?
defmodule Zipato.Sessions.Hub.Impl do
alias Zipato.Sessions.Behaviour
use Behaviour
@moduledoc """
Implementation for hub session
See `Zipato.Sessions.Hub` for more information.
alias Zipato.Commands.{Authentication}
@doc """
Connects a hub session
@impl Behaviour
def connect(%{serial: serial} = state, config) do
{:ok, session_id} = Authentication.connect_box_session(serial, config.credentials, config.api)
%{state | id: session_id}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment