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

Persistent storage for device information and other Grizzly internals.

# `key`

```elixir
@type key() :: PropertyTable.property()
```

See `t:PropertyTable.property/0`.

# `node_inclusion_info`

```elixir
@type node_inclusion_info() :: %{
  status:
    Grizzly.ZWave.CommandClasses.NetworkManagementInclusion.node_add_status(),
  granted_keys: [Grizzly.ZWave.Security.key()],
  kex_fail_type: Grizzly.ZWave.Security.key_exchange_fail_type() | nil,
  smartstart?: boolean()
}
```

# `node_info`

```elixir
@type node_info() :: %{
  listening?: boolean(),
  basic_device_class: Grizzly.ZWave.DeviceClasses.basic_device_class(),
  generic_device_class: Grizzly.ZWave.DeviceClasses.generic_device_class(),
  specific_device_class: Grizzly.ZWave.DeviceClasses.specific_device_class(),
  command_classes: Grizzly.ZWave.CommandClasses.command_class_list()
}
```

# `pattern`

```elixir
@type pattern() :: PropertyTable.pattern()
```

See `t:PropertyTable.pattern/0`.

# `put_node_info_opt`

```elixir
@type put_node_info_opt() :: {:overwrite_command_classes, boolean()}
```

# `value`

```elixir
@type value() :: PropertyTable.value()
```

See `t:PropertyTable.value/0`.

# `child_spec`

```elixir
@spec child_spec(PropertyTable.options()) :: Supervisor.child_spec()
```

Returns a child spec to start the storage process under a supervisor.
See `Supervisor`.

# `delete_all`

```elixir
@spec delete_all() :: :ok
```

Delete everything from storage.

# `delete_matches`

```elixir
@spec delete_matches(pattern()) :: :ok
```

Delete keys matching a pattern using the configured adapter.

# `get`

```elixir
@spec get(key()) :: value()
```

Get a value from storage by key using the configured adapter.

# `get_node_command_class_version`

```elixir
@spec get_node_command_class_version(Grizzly.ZWave.node_id(), atom()) ::
  pos_integer() | nil
```

Retrieves a node's command class version.

# `get_node_dsk`

```elixir
@spec get_node_dsk(Grizzly.ZWave.node_id()) :: Grizzly.ZWave.DSK.t() | nil
```

Returns a node's stored DSK.

# `get_node_inclusion_info`

```elixir
@spec get_node_inclusion_info(Grizzly.ZWave.node_id()) :: node_inclusion_info() | nil
```

Retrieves information about a node's inclusion process.

# `get_node_info`

```elixir
@spec get_node_info(Grizzly.ZWave.node_id()) :: node_info() | nil
```

Retrieves a node's basic info.

# `get_node_last_awake`

```elixir
@spec get_node_last_awake(Grizzly.ZWave.node_id()) :: DateTime.t() | nil
```

Retrieves a node's last awake time.

# `get_node_wakeup_interval`

```elixir
@spec get_node_wakeup_interval(Grizzly.ZWave.node_id()) :: non_neg_integer() | nil
```

Returns the node's wakeup interval in seconds.

# `match`

```elixir
@spec match(pattern()) :: [{key(), value()}]
```

Match keys in storage against a pattern using the configured adapter.

# `put`

```elixir
@spec put(key(), value()) :: :ok
```

Puts a key-value pair into storage using the configured adapter.

# `put_many`

```elixir
@spec put_many([{key(), value()}]) :: :ok
```

Puts multiple key-value pairs into storage using the configured adapter.

# `put_node_command_class_version`

```elixir
@spec put_node_command_class_version(Grizzly.ZWave.node_id(), atom(), pos_integer()) ::
  :ok
```

Stores a node's command class version.

# `put_node_dsk`

```elixir
@spec put_node_dsk(Grizzly.ZWave.node_id(), Grizzly.ZWave.DSK.t()) :: :ok
```

Store a node's DSK.

# `put_node_inclusion_info`

```elixir
@spec put_node_inclusion_info(Grizzly.ZWave.node_id(), node_inclusion_info()) :: :ok
```

Stores information about a node's inclusion process.

# `put_node_info`

```elixir
@spec put_node_info(
  Grizzly.ZWave.node_id(),
  Grizzly.ZWave.Command.t() | node_info(),
  [
    put_node_info_opt()
  ]
) :: :ok
```

Stores node information.

By default, command classes are merged using `CommandClasses.merge/2` to prevent
loss of data due to Z/IP Gateway quirks. To force the use of the new command class
list, use the `:overwrite_command_classes` option.

# `put_node_last_awake`

```elixir
@spec put_node_last_awake(Grizzly.ZWave.node_id(), DateTime.t()) :: :ok
```

Stores a node's last awake time.

# `put_node_wakeup_interval`

```elixir
@spec put_node_wakeup_interval(Grizzly.ZWave.node_id(), non_neg_integer()) :: :ok
```

Stores a node's wakeup interval in seconds.

---

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