View Source Grizzly.ZWave.CommandClasses.SensorBinary (grizzly v8.5.3)

Deprecated command class for triggered/not triggered sensors.

Summary

Functions

Decode a list of sensor types from a bitmap.

Parse the type value from a byte

Encode a list of sensor types as a bitmap.

Encode the type value for the sensor report

Types

@type sensor_type() ::
  :general_purpose
  | :smoke
  | :co
  | :co2
  | :heat
  | :water
  | :freeze
  | :tamper
  | :aux
  | :door_window
  | :tilt
  | :motion
  | :glass_break

Functions

Link to this function

decode_sensor_types(binary)

View Source
@spec decode_sensor_types(binary()) ::
  {:ok, [{:sensor_types, [atom()]}]} | {:error, Grizzly.ZWave.DecodeError.t()}

Decode a list of sensor types from a bitmap.

Examples

iex> decode_sensor_types(<<0x40, 0x00>>)
{:ok, sensor_types: [:water]}
@spec decode_type(byte()) ::
  {:ok, sensor_type()} | {:error, Grizzly.ZWave.DecodeError.t()}

Parse the type value from a byte

Link to this function

encode_sensor_types(sensor_types)

View Source
@spec encode_sensor_types([atom()]) :: binary()

Encode a list of sensor types as a bitmap.

Examples

iex> encode_sensor_types([:water])
<<0x40, 0x00>>
@spec encode_type(sensor_type()) :: byte()

Encode the type value for the sensor report