Espex.SerialProxy.Info (espex v0.1.1)

Copy Markdown View Source

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

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

Summary

Functions

Build an %Info{} from keyword options.

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

Types

port_type()

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

t()

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

Functions

new(opts)

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

Build an %Info{} from keyword options.

to_proto(info)

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

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