grizzly v0.6.0 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.
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
association_opt()
View Source
association_opt() ::
{:network_state, Grizzly.Network.State.state()} | {:extra_nodes, [node_id()]}
association_opt() :: {:network_state, Grizzly.Network.State.state()} | {:extra_nodes, [node_id()]}
node_id()
View Source
node_id() :: non_neg_integer()
node_id() :: non_neg_integer()
security()
View Source
security() :: :none | :failed | :s0 | :s2_unauthenticated | :s2_authenticated
security() :: :none | :failed | :s0 | :s2_unauthenticated | :s2_authenticated
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,
id: node_id(),
ip_address: :inet.ip_address() | nil,
listening?: boolean(),
security: security(),
specific_cmd_class: atom() | nil
}
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, id: node_id(), ip_address: :inet.ip_address() | nil, listening?: boolean(), security: security(), specific_cmd_class: atom() | nil }
Link to this section Functions
add_lifeline_group(zw_node, association_opts \\ [])
View Source
add_lifeline_group(t(), [association_opt()]) :: {:ok, t()}
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.
command_class(node, command_class_name)
View Source
command_class(t(), atom()) ::
{:ok, Grizzly.CommandClass.t()} | {:error, :not_found}
command_class(t(), atom()) :: {:ok, Grizzly.CommandClass.t()} | {:error, :not_found}
Get the node's command class by name
command_class_names(node) View Source
Get the list of names of command classes supported by the node.
command_class_versions_known?(zw_node) View Source
Whether the versions of a node's command class are all known
configure_association(zw_node, association, association_opts \\ [])
View Source
configure_association(t(), Grizzly.Node.Association.t(), [association_opt()]) ::
{:ok, t()}
configure_association(t(), Grizzly.Node.Association.t(), [association_opt()]) :: {:ok, t()}
Given a Node and an Association configure the node to have association.
connect(zw_node, opts \\ []) View Source
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
connected?(node) View Source
Whether a node is connected
disconnect(node)
View Source
disconnect(t()) :: :ok
disconnect(t()) :: :ok
get_association_list(node)
View Source
get_association_list(t()) :: [Grizzly.Node.Association.t()]
get_association_list(t()) :: [Grizzly.Node.Association.t()]
Gets the association list of a Node.t
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_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.
get_ip(node_id)
View Source
get_ip(t() | node_id()) ::
{:ok, :inet.ip_address()} | {:error, :nack_response}
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
has_command_class?(zw_node, command_class) View Source
Checks to see if the node has a particular command class
initialize_command_versions(zw_node) View Source
Initialize a node's command classes with the default version
make_config(node, opts \\ [])
View Source
make_config(t(), opts :: keyword()) :: Grizzly.Conn.Config.t()
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.
new(opts \\ []) View Source
put_association(zw_node, association)
View Source
put_association(t(), Grizzly.Node.Association.t()) :: t()
put_association(t(), Grizzly.Node.Association.t()) :: t()
Put an Association into the association list of a node.
put_ip(zw_node, ip_address)
View Source
put_ip(t(), :inet.ip_address()) :: t()
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.
update(zw_node, opts \\ []) View Source
Batch update a Node's fields with new info.
update_command_class(zw_node, command_class)
View Source
update_command_class(t(), Grizzly.CommandClass.t()) :: t()
update_command_class(t(), Grizzly.CommandClass.t()) :: t()
Update a command class of a node.
update_command_class_versions(zw_node) View Source
Update the command class versions of a node