Espex.InfraredProxy.Entity (espex v0.1.1)

Copy Markdown View Source

Description of an infrared device exposed as an ESPHome entity.

Adapters return a list of these from Espex.InfraredProxy.list_entities/0. The :key is the stable identifier used by clients for state reporting and commands — the adapter is responsible for generating keys that remain consistent across restarts (e.g., hash of a serial number or MAC).

Summary

Functions

Build an entity from keyword options.

Convert to the protobuf message sent during ListEntitiesRequest.

Types

capability()

@type capability() :: :transmit | :receive

t()

@type t() :: %Espex.InfraredProxy.Entity{
  capabilities: [capability()],
  disabled_by_default: boolean(),
  entity_category: atom(),
  icon: String.t(),
  key: non_neg_integer(),
  name: String.t(),
  object_id: String.t()
}

Functions

can_receive?(entity)

@spec can_receive?(t()) :: boolean()

can_transmit?(entity)

@spec can_transmit?(t()) :: boolean()

new(opts)

@spec new(keyword()) :: t()

Build an entity from keyword options.

to_proto(entity)

@spec to_proto(t()) :: Espex.Proto.ListEntitiesInfraredResponse.t()

Convert to the protobuf message sent during ListEntitiesRequest.