my_sensors v0.1.0-rc2 MySensors.Context

Repo Context for MySensors

Link to this section Summary

Functions

Get all nodes

Get all sensors

Delete a node by id

Get a node by id

Get a sensor from node_id and sensor_id

Get a nenw node

Save a node’s battery_level

Save the config of a node from a packet

Saves the protocol of a node from a packet

Save a sensor on a node

Save a sensor_value from a sensor

Save a node’s sketch_name

Save a node’s sketch_version

Link to this section Functions

Link to this function all_nodes()
all_nodes() :: [MySensors.Node.t()]

Get all nodes.

Link to this function all_sensors(node_id)
all_sensors(integer()) :: [MySensors.Sensor.t()] | nil

Get all sensors.

Link to this function delete_node(id)

Delete a node by id.

Link to this function get_node(id)
get_node(integer()) :: MySensors.Node.t() | nil

Get a node by id.

Link to this function get_sensor(node_id, child_sensor_id)
get_sensor(integer(), integer()) :: MySensors.Sensor.t() | nil

Get a sensor from node_id and sensor_id

Link to this function new_node()
new_node() :: MySensors.Node.t()

Get a nenw node.

Link to this function save_battery_level(packet)
save_battery_level(MySensors.Packet.t()) ::
  {:ok, MySensors.Node.t()} |
  {:error, term()}

Save a node’s battery_level

Link to this function save_config(packet)
save_config(MySensors.Packet.t()) ::
  {:ok, MySensors.Node.t()} |
  {:error, term()}

Save the config of a node from a packet.

Link to this function save_protocol(packet)
save_protocol(MySensors.Packet.t()) ::
  {:ok, MySensors.Node.t()} |
  {:error, term()}

Saves the protocol of a node from a packet

Link to this function save_sensor(packet)
save_sensor(MySensors.Packet.t()) ::
  {:ok, MySensors.Sensor.t()} |
  {:error, term()}

Save a sensor on a node.

Link to this function save_sensor_value(packet)
save_sensor_value(MySensors.Packet.t()) ::
  {:ok, MySensors.SensorValue.t()} |
  {:error, term()}

Save a sensor_value from a sensor.

Link to this function save_sketch_name(packet)
save_sketch_name(MySensors.Packet.t()) ::
  {:ok, MySensors.Node.t()} |
  {:error, term()}

Save a node’s sketch_name

Link to this function save_sketch_version(packet)
save_sketch_version(MySensors.Packet.t()) ::
  {:ok, MySensors.Node.t()} |
  {:error, term()}

Save a node’s sketch_version

Link to this function update_node(node, params)
update_node(MySensors.Node.t(), map()) ::
  {:ok, MySensors.Node.t()} |
  {:error, term()}

Updata a node.

Link to this function update_sensor(sensor, params)