# `Grizzly.Associations`
[🔗](https://github.com/smartrent/grizzly/blob/v9.1.4/lib/grizzly/associations.ex#L1)

Storage for Z-Wave association groups. Supports both standard and multi channel
associations.

# `grouping_id`

```elixir
@type grouping_id() :: byte()
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `delete_all`

```elixir
@spec delete_all(GenServer.server()) :: :ok
```

Delete all the associations

# `delete_all_nodes_from_grouping`

```elixir
@spec delete_all_nodes_from_grouping(GenServer.server(), grouping_id()) :: :ok
```

Delete all the nodes from the grouping

# `delete_nodes_from_all_groupings`

```elixir
@spec delete_nodes_from_all_groupings(GenServer.server(), [Grizzly.ZWave.node_id()]) ::
  :ok
```

Delete the nodes from each association group

# `delete_nodes_from_grouping`

```elixir
@spec delete_nodes_from_grouping(GenServer.server(), grouping_id(), [
  Grizzly.ZWave.node_id()
]) ::
  :ok | {:error, :invalid_grouping_id}
```

Delete the specified nodes from the association grouping

# `get`

```elixir
@spec get(GenServer.server(), grouping_id()) ::
  Grizzly.Associations.Association.t() | nil
```

Get an association by the grouping id

# `get_all`

```elixir
@spec get_all(GenServer.server()) :: [Grizzly.Associations.Association.t()]
```

Get all the associations

# `save`

```elixir
@spec save(GenServer.server(), grouping_id(), [Grizzly.ZWave.node_id()]) ::
  :ok | :error
```

Save the node ids to the grouping id

# `start_link`

```elixir
@spec start_link(Grizzly.Options.t(), GenServer.options()) :: GenServer.on_start()
```

Start the Associations server

If you pass the GenServer option for a name you can access the server with
that name. However, if no name is passed to the `server_opts` then it will
fallback to using the `Grizzly.Associations` module name

---

*Consult [api-reference.md](api-reference.md) for complete listing*
