# `Espex.SerialProxy.Info`
[🔗](https://github.com/bbangert/espex/blob/main/lib/espex/serial_proxy/info.ex#L1)

Description of a serial proxy instance exposed by an `Espex.SerialProxy`
adapter.

Adapters return a list of these from `c:Espex.SerialProxy.list_instances/0`.
The `:instance` integer is the stable identifier used by the ESPHome client
in `SerialProxyConfigureRequest`, `SerialProxyWriteRequest`, etc. — the
adapter chooses the numbering and must keep it stable for the lifetime of
the device.

# `port_type`

```elixir
@type port_type() :: :ttl | :rs232 | :rs485
```

# `t`

```elixir
@type t() :: %Espex.SerialProxy.Info{
  instance: non_neg_integer(),
  name: String.t(),
  port_type: port_type()
}
```

# `new`

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

Build an `%Info{}` from keyword options.

# `to_proto`

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

Convert to the protobuf `SerialProxyInfo` message used inside
`DeviceInfoResponse.serial_proxies`.

---

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