Fetch Home Assistant's floor, area, device, entity and label registries.
Each function sends the matching config/*_registry/list command through
Hassock.Connection.command/4 and decodes the items into structs.
Options: :timeout in ms (default 30 s; the entity registry of a large
install is several MB).
list_entities/2 uses config/entity_registry/list, which returns full
entries including hidden_by and disabled_by. HA's frontend uses the
compact config/entity_registry/list_for_display instead: it abbreviates
keys and leaves out disabled entities and some fields. Call it with
Hassock.command/4 if you need it.
To keep the registries current, subscribe to their update events
(Hassock.Protocol.registry_event_types/0) or use Hassock.RegistryCache.
Summary
Functions
Decode one registry item of kind into its struct.
The key that identifies an item of kind.
The registry kinds, in dependency order (floors before areas, ...).
List one registry by kind.
List all areas.
List all devices.
List all entity registry entries.
List all floors.
List all labels.
Types
Functions
Decode one registry item of kind into its struct.
The key that identifies an item of kind.
@spec kinds() :: [kind()]
The registry kinds, in dependency order (floors before areas, ...).
@spec list(GenServer.server(), kind(), keyword()) :: {:ok, [struct()]} | {:error, Hassock.Connection.command_error() | {:unexpected_result, term()}}
List one registry by kind.
@spec list_areas(GenServer.server(), keyword()) :: {:ok, [Hassock.Area.t()]} | {:error, Hassock.Connection.command_error()}
List all areas.
@spec list_devices(GenServer.server(), keyword()) :: {:ok, [Hassock.Device.t()]} | {:error, Hassock.Connection.command_error()}
List all devices.
@spec list_entities(GenServer.server(), keyword()) :: {:ok, [Hassock.EntityEntry.t()]} | {:error, Hassock.Connection.command_error()}
List all entity registry entries.
@spec list_floors(GenServer.server(), keyword()) :: {:ok, [Hassock.Floor.t()]} | {:error, Hassock.Connection.command_error()}
List all floors.
@spec list_labels(GenServer.server(), keyword()) :: {:ok, [Hassock.Label.t()]} | {:error, Hassock.Connection.command_error()}
List all labels.