Grizzly.Events (grizzly v8.13.0)

View Source

Pubsub registry for Grizzly events other than Z-Wave commands from devices.

Events

Ready

This event is emitted when Z/IP Gateway has started and Grizzly is ready to process commands.

OTW Firmware Update

This event is emitted when updating the firmware on the Z-Wave module. The payload indicates the status. See Grizzly.ZWaveFirmware.update_status/0.

Serial API Status

This event is emitted when the serial API appears to be unresponsive (or recovers from this state) based on Z/IP Gateway's log output.

Summary

Functions

Subscribe to an event, all commands from a node, or a specific command from any node.

List a process's subscriptions.

Unsubscribe from one or more Grizzly events.

Types

event()

@type event() :: :ready | :otw_firmware_update | :serial_api_status

subject()

@type subject() ::
  event() | Grizzly.command() | Grizzly.node_id() | {:node, Grizzly.node_id()}

subscribe_opt()

@type subscribe_opt() :: {:firehose, boolean()}

subscribe_opts()

@type subscribe_opts() :: [subscribe_opt()]

subscriptions()

@type subscriptions() :: [
  event: [event()],
  commands: [Grizzly.command()],
  nodes: [Grizzly.node_id()]
]

Functions

child_spec(_)

@spec child_spec(any()) :: Supervisor.child_spec()

subscribe(subject, opts \\ [])

@spec subscribe(subject() | [subject()], subscribe_opts()) :: :ok

Subscribe to an event, all commands from a node, or a specific command from any node.

Options

  • :firehose - Normally, subscribers will only receive unsolicited commands from the node (or command) they are subscribed to. If this option is set to true, subscribers will receive all incoming commands that match, including responses to commands sent via Grizzly.send_command/4. Defaults to false.

subscriptions(pid \\ self())

@spec subscriptions(GenServer.server()) :: subscriptions()

List a process's subscriptions.

unsubscribe(subject)

@spec unsubscribe(subject() | [subject()]) :: :ok

Unsubscribe from one or more Grizzly events.