# `Espex.InfraredProxy.Entity`
[🔗](https://github.com/bbangert/espex/blob/main/lib/espex/infrared_proxy/entity.ex#L1)

Description of an infrared device exposed as an ESPHome entity.

Adapters return a list of these from `c: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).

# `capability`

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

# `t`

```elixir
@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()
}
```

# `can_receive?`

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

# `can_transmit?`

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

# `new`

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

Build an entity from keyword options.

# `to_proto`

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

Convert to the protobuf message sent during `ListEntitiesRequest`.

---

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