Skip to content

siegfried/j1605

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

J1605

J1605 is a switch hub with 16 relays can be controlled on TCP.

Installation

If available in Hex, the package can be installed by adding j1605 to your list of dependencies in mix.exs:

def deps do
  [{:j1605, "~> 0.2.0"}]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/j1605.

Configuration

use Mix.Config

config :j1605,
  device: [
    address: "192.168.1.250",
    port: 2000
  ]

Usage

  1. Subscribe the switch events:
J1605.subscribe()
  1. Receive the switch states:
{:states, {true, true, false, false, false, false, false, false,
          true, false, false, false, false, false, false, false}}
  1. Turn on a switch:
J1605.turn_on(0) # between 0 and 15
  1. Turn off a switch:
J1605.turn_off(0) # between 0 and 15
  1. Update states:
J1605.update_states()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages