grizzly v0.8.4 Grizzly.Node View Source

Data structure representing a Z-Wave Node

Link to this section Summary

Functions

Add a lifeline group association to this node.

Get the node's command class by name

Get the list of names of command classes supported by the node.

Whether the versions of a node's command class are all known

Given a Node and an Association configure the node to have association.

Establish a connection with a Node

Whether a node is connected

Gets the association list of a Node.t

Get the version of a node's command class, if the node does not have a version for this command class this function will try to get it from the Z-Wave network.

Get the Node's IP adress.

Get the node network information like ip address and Z-Wave network home id

Checks to see if the node has a particular command class

Initialize a node's command classes with the default version

Make the Node's Conn.Config. This will use the Grizzly.config() function but it will replace the ip_address field of that config with the Node's IP address.

Put an Association into the association list of a node.

Adds the IP address to the node structure. If there is an IP address already part of the node this will override that field.

Batch update a Node's fields with new info.

Update a command class of a node.

Update the command class versions of a node

Link to this section Types

Link to this type

association_opt() View Source
association_opt() ::
  {:network_state, Grizzly.Network.State.state()} | {:extra_nodes, [node_id()]}

Link to this type

security() View Source
security() :: :none | :failed | :s0 | :s2_unauthenticated | :s2_authenticated

Link to this type

t() View Source
t() :: %Grizzly.Node{
  associations: [Grizzly.Node.Association.t()],
  basic_cmd_class: atom() | nil,
  command_classes: [Grizzly.CommandClass.t()],
  conn: Grizzly.Conn.t() | nil,
  generic_cmd_class: atom() | nil,
  home_id: pos_integer(),
  id: node_id(),
  ip_address: :inet.ip_address() | nil,
  listening?: boolean(),
  security: security(),
  specific_cmd_class: atom() | nil
}

Link to this section Functions

Link to this function

add_lifeline_group(zw_node, association_opts \\ []) View Source
add_lifeline_group(t(), [association_opt()]) :: {:ok, t()}

Add a lifeline group association to this node.

By default the lifeline group contains the controller node (id 1), so the extra_nodes field is a list of node ids to also be added to this node's lifeline group.

Link to this function

command_class(node, command_class_name) View Source
command_class(t(), atom()) ::
  {:ok, Grizzly.CommandClass.t()} | {:error, :not_found}

Get the node's command class by name

Link to this function

command_class_names(node) View Source
command_class_names(t()) :: [atom()]

Get the list of names of command classes supported by the node.

Link to this function

command_class_versions_known?(zw_node) View Source
command_class_versions_known?(t()) :: boolean()

Whether the versions of a node's command class are all known

Link to this function

configure_association(zw_node, association, association_opts \\ []) View Source
configure_association(t(), Grizzly.Node.Association.t(), [association_opt()]) ::
  {:ok, t()}

Given a Node and an Association configure the node to have association.

Link to this function

connect(zw_node, opts \\ []) View Source
connect(t(), keyword()) :: {:ok, t()}

Establish a connection with a Node

Pass in connection options to build a Grizzly.Conn, will use Grizzly.conn() to build default values.

If the node does not have an IP address, this function will attempt to retrieve that information from the Z-Wave network

Link to this function

connected?(node) View Source
connected?(t()) :: boolean()

Whether a node is connected

Link to this function

disconnect(node) View Source
disconnect(t()) :: :ok

Link to this function

get_association_list(node) View Source
get_association_list(t()) :: [Grizzly.Node.Association.t()]

Gets the association list of a Node.t

Link to this function

get_command_class_version(zw_node, command_class_name) View Source
get_command_class_version(t(), Grizzly.CommandClass.name()) ::
  {:ok, Grizzly.CommandClass.version()}
  | {:error,
     :command_class_not_found
     | :timeout_get_command_class_version
     | :command_queued}

Get the version of a node's command class, if the node does not have a version for this command class this function will try to get it from the Z-Wave network.

Link to this function

get_ip(node_id) View Source
get_ip(t() | node_id()) ::
  {:ok, :inet.ip_address()} | {:error, :nack_response}

Get the Node's IP adress.

If the node does not have an IP address this function will ask the Z-Wave network to provide the address. Normally, it is good to called put_ip/2 after this function.

If the node has the IP address already, then this function will return that address

Link to this function

get_network_information(node_id) View Source
get_network_information(t() | node_id()) ::
  {:ok, Grizzly.CommandClass.ZipNd.InvNodeSolicitation.report()}
  | {:error, any()}

Get the node network information like ip address and Z-Wave network home id

Link to this function

has_command_class?(zw_node, command_class) View Source
has_command_class?(t(), command_class :: atom()) :: boolean()

Checks to see if the node has a particular command class

Link to this function

initialize_command_versions(zw_node) View Source
initialize_command_versions(t()) :: t()

Initialize a node's command classes with the default version

Link to this function

make_config(node, opts \\ []) View Source
make_config(t(), opts :: keyword()) :: Grizzly.Conn.Config.t()

Make the Node's Conn.Config. This will use the Grizzly.config() function but it will replace the ip_address field of that config with the Node's IP address.

And optional keyword list of config overrides can be provided. See Grizzly.Conn.Config module for the valid fields.

Link to this function

new(opts \\ []) View Source
new(opts :: keyword()) :: t()

Link to this function

put_association(zw_node, association) View Source
put_association(t(), Grizzly.Node.Association.t()) :: t()

Put an Association into the association list of a node.

Link to this function

put_ip(zw_node, ip_address) View Source
put_ip(t(), :inet.ip_address()) :: t()

Adds the IP address to the node structure. If there is an IP address already part of the node this will override that field.

Link to this function

update(zw_node, opts \\ []) View Source
update(t(), opts :: keyword() | map()) :: t()

Batch update a Node's fields with new info.

Link to this function

update_command_class(zw_node, command_class) View Source
update_command_class(t(), Grizzly.CommandClass.t()) :: t()

Update a command class of a node.

Link to this function

update_command_class_versions(zw_node) View Source
update_command_class_versions(t()) :: t()

Update the command class versions of a node