esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
esphome::api Namespace Reference

Namespaces

namespace  noise
 
namespace  proto
 

Classes

struct  AlarmControlPanelCommand
 A command to change an alarm control panel's state. More...
 
class  AlarmControlPanelEntity
 Handle to a AlarmControlPanel entity. More...
 
struct  AlarmControlPanelInfo
 Static description of an alarm control panel entity. More...
 
struct  AlarmControlPanelStatus
 An alarm control panel's reported state. More...
 
class  ApiError
 Base class for every error raised by the library. More...
 
class  AuthenticationError
 Authentication was rejected, or the negotiated API version is unsupported. More...
 
class  BinarySensorEntity
 Handle to a BinarySensor entity. More...
 
struct  BinarySensorInfo
 Static description of a binary sensor entity. More...
 
struct  BinarySensorState
 A binary sensor's reported value. More...
 
struct  BleAdvertisement
 A parsed BLE advertisement (api: BluetoothLEAdvertisementResponse). More...
 
struct  BleConnection
 Connection state update for a device (api: BluetoothDeviceConnectionResponse). More...
 
struct  BleConnectionsFree
 Number of free connection slots (api: BluetoothConnectionsFreeResponse). More...
 
struct  BleGattCharacteristic
 One characteristic within a GATT service. More...
 
struct  BleGattCharProperties
 Typed view of the standard BLE GATT characteristic property bits. More...
 
struct  BleGattDescriptor
 One descriptor within a GATT characteristic. More...
 
struct  BleGattError
 A GATT operation error (api: BluetoothGATTErrorResponse). More...
 
struct  BleGattNotifyData
 Notification payload from a GATT characteristic (api: BluetoothGATTNotifyDataResponse). More...
 
struct  BleGattRead
 Result of a GATT characteristic read (api: BluetoothGATTReadResponse). More...
 
struct  BleGattReadResult
 Result of a one-shot GATT read: either data (ok) or error (!ok). More...
 
struct  BleGattService
 One GATT service exposed by a device. More...
 
struct  BleGattServices
 A batch of GATT services for a device (api: BluetoothGATTGetServicesResponse). More...
 
struct  BleGattServicesResult
 Result of a one-shot GATT service discovery (all batches collected). More...
 
struct  BleGattWriteResult
 Result of a one-shot GATT write. More...
 
struct  BleManufacturerData
 Manufacturer-specific data blob attached to an advertisement. More...
 
struct  BleRawAdvertisement
 A single raw, unparsed BLE advertisement (api: BluetoothLERawAdvertisement). More...
 
struct  BleScannerState
 State of the device's BLE scanner (api: BluetoothScannerStateResponse). More...
 
struct  BleServiceData
 Service or manufacturer data blob attached to an advertisement. More...
 
class  BluetoothProxy
 Scans for, connects to, and talks GATT to BLE devices through the device's Bluetooth proxy. More...
 
struct  ButtonCommand
 A command to press a button. More...
 
class  ButtonEntity
 Handle to a Button entity. More...
 
struct  ButtonInfo
 Static description of a button entity. More...
 
class  ByteView
 Non-owning view over a contiguous run of bytes (a C++17 stand-in for std::span<const std::uint8_t>). More...
 
class  CameraEntity
 Handle to a Camera entity. More...
 
struct  CameraInfo
 Static description of a camera entity. More...
 
class  Client
 Async client for a single device. More...
 
struct  ClientOptions
 Everything needed to reach and authenticate with one ESPHome device. More...
 
struct  ClimateCommand
 A command to mutate a climate entity. Each optional field is sent only when engaged. More...
 
class  ClimateEntity
 Handle to a Climate entity. More...
 
struct  ClimateInfo
 Static description of a climate entity. More...
 
struct  ClimateState
 A climate entity's reported state. More...
 
class  Connection
 Drives one logical session with an ESPHome device: TCP connect, optional Noise handshake (via the injected frame helper), HelloRequest/HelloResponse, keepalive pings and inbound message dispatch. More...
 
class  ConnectionError
 TCP-level failure: connect refused, reset, EOF, host unreachable. More...
 
struct  ConnectionOptions
 Knobs controlling a single Connection. Defaults mirror aioesphomeapi. More...
 
struct  CoverCommand
 A command targeting a cover entity. More...
 
class  CoverEntity
 Handle to a Cover entity. More...
 
struct  CoverInfo
 Static description of a cover entity. More...
 
struct  CoverState
 A cover's reported state. More...
 
struct  DateCommand
 A command to set a date's value. More...
 
class  DateEntity
 Handle to a Date entity. More...
 
struct  DateInfo
 Static description of a date entity. More...
 
struct  DateState
 A date's reported value. More...
 
struct  DateTimeCommand
 A command to set a datetime's value. More...
 
class  DateTimeEntity
 Handle to a DateTime entity. More...
 
struct  DateTimeInfo
 Static description of a datetime entity. More...
 
struct  DateTimeState
 A datetime's reported value. More...
 
struct  DeviceInfo
 Ergonomic, copyable snapshot of a device's identity and capabilities, converted from the raw DeviceInfoResponse. More...
 
struct  DiscoveredDevice
 An ESPHome device found on the local network. More...
 
class  Discovery
 Discovers ESPHome devices via multicast DNS. More...
 
class  EncryptionError
 A symmetric encrypt/decrypt operation failed (AEAD tag mismatch, bad nonce). More...
 
class  EncryptionMismatchError
 The connection's encryption mode does not match the device: a plaintext client reached a device that requires Noise, or an encrypted client reached a plaintext-only device. More...
 
class  Entity
 Common base: entity identity and the owning client. More...
 
struct  EntityInfo
 Fields present on every ListEntities*Response. More...
 
class  EntityList
 A snapshot list of entity handles of one domain, with index + lookup access. More...
 
class  EntityRegistry
 Object-oriented façade over the entity store. More...
 
class  EntityStore
 Collects a device's entity descriptions and live states. More...
 
class  EventEntity
 Handle to a Event entity. More...
 
struct  EventInfo
 Static description of an event entity. More...
 
struct  EventState
 An event's reported value. More...
 
class  Executor
 Minimal executor: deferred execution plus one-shot timers. More...
 
struct  FanCommand
 A command to mutate a fan. Each optional field is sent only when engaged. More...
 
class  FanEntity
 Handle to a Fan entity. More...
 
struct  FanInfo
 Static description of a fan entity. More...
 
struct  FanState
 A fan's reported state. More...
 
class  FrameHelper
 Stateful codec sitting between the transport and the connection. More...
 
class  HandshakeError
 The Noise handshake failed (bad PSK, MAC mismatch, unexpected message). More...
 
class  HomeAssistantServices
 Discovers user-defined services and invokes them. More...
 
class  InfoResponseBase
 Intermediate base for ListEntities*Response messages (proto (base_class) = "InfoResponseProtoMessage"). More...
 
class  InfraredEntity
 Handle to a Infrared entity. More...
 
struct  InfraredInfo
 Static description of an infrared entity. More...
 
struct  LightCommand
 A command to mutate a light. Each optional field is sent only when engaged. More...
 
class  LightEntity
 Handle to a Light entity. More...
 
struct  LightInfo
 Static description of a light entity. More...
 
struct  LightRgb
 RGB triple, set together via the single has_rgb command flag. More...
 
struct  LightState
 A light's reported state. More...
 
struct  LockCommandData
 A command targeting a lock entity. More...
 
class  LockEntity
 Handle to a Lock entity. More...
 
struct  LockEntityState
 A lock's reported state. More...
 
struct  LockInfo
 Static description of a lock entity. More...
 
struct  LogEntry
 A single log line streamed from the device. More...
 
class  LogStream
 Subscribes to and surfaces the device's log stream. More...
 
struct  MediaPlayerControl
 A command to mutate a media player. More...
 
class  MediaPlayerEntity
 Handle to a MediaPlayer entity. More...
 
struct  MediaPlayerInfo
 Static description of a media player entity. More...
 
struct  MediaPlayerStatus
 A media player's reported state. More...
 
struct  MediaPlayerSupportedFormat
 A single audio format advertised as supported by a media player. More...
 
class  MessageRegistry
 Maps the protocol's numeric message ids (the proto (id) option) to and from concrete message types. More...
 
struct  NoiseConfig
 Configuration for an encrypted connection. More...
 
class  NoiseFrameHelper
 Encrypted frame codec. More...
 
struct  NumberCommand
 A command to set a number's value. More...
 
class  NumberEntity
 Handle to a Number entity. More...
 
struct  NumberInfo
 Static description of a number entity. More...
 
struct  NumberState
 A number's reported value. More...
 
class  PlaintextFrameHelper
 Codec for the plaintext native-API framing: More...
 
class  ProtocolError
 The peer violated the framing or message protocol (bad indicator byte, oversized frame, malformed varint, undecodable payload, ...). More...
 
class  ProtoMessage
 Base class every generated message derives from. More...
 
class  ProtoReader
 
class  ProtoWriter
 
class  RadioFrequencyEntity
 Handle to a RadioFrequency entity. More...
 
struct  RadioFrequencyInfo
 Static description of a radio frequency entity. More...
 
struct  SelectCommand
 A command to set a select's value. More...
 
class  SelectEntity
 Handle to a Select entity. More...
 
struct  SelectInfo
 Static description of a select entity. More...
 
struct  SelectState
 A select's reported value. More...
 
class  SensorEntity
 Handle to a Sensor entity. More...
 
struct  SensorInfo
 Static description of a sensor entity. More...
 
struct  SensorState
 A sensor's reported value. More...
 
class  SerialPort
 A single serial-proxy instance bound to its index — the instance-aware, ergonomic front end to SerialProxy (no instance argument on every call). More...
 
class  SerialProxy
 Proxies a UART on the device, forwarding data and control to clients. More...
 
struct  SerialProxyConfig
 UART parameters for a serial proxy instance (api: SerialProxyConfigureRequest). More...
 
struct  SerialProxyData
 Data forwarded from a serial device (api: SerialProxyDataReceived). More...
 
struct  SerialProxyLineStates
 Typed view of the modem control/status lines exchanged with the proxy. More...
 
struct  SerialProxyModemPins
 Current modem control pin states (api: SerialProxyGetModemPinsResponse). More...
 
struct  SerialProxyPortInfo
 One serial-proxy port advertised by the device. More...
 
struct  SerialProxyResponse
 Result of a SerialProxyRequest (api: SerialProxyRequestResponse). More...
 
struct  ServerHello
 Information returned by the device in its HelloResponse. More...
 
struct  SirenCommand
 A command targeting a siren entity. More...
 
class  SirenEntity
 Handle to a Siren entity. More...
 
struct  SirenInfo
 Static description of a siren entity. More...
 
struct  SirenState
 A siren's reported state. More...
 
class  StateResponseBase
 Intermediate base for *StateResponse messages (proto (base_class) = "StateResponseProtoMessage"). More...
 
struct  StoredEntity
 A single tracked entity: its domain, identity, and the latest raw info/ state protobuf messages (decoded on demand by the typed accessors). More...
 
class  Subsystem
 Shared base for the subsystems exposed by Client (log streaming, the various proxies, voice assistant, ...). More...
 
struct  SwitchCommand
 A command to change a switch's state. More...
 
class  SwitchEntity
 Handle to a Switch entity. More...
 
struct  SwitchInfo
 Static description of a switch entity. More...
 
struct  SwitchState
 A switch's reported state. More...
 
class  SyncClient
 Synchronous, single-threaded client. More...
 
struct  TextCommand
 A command to set a text entity's value. More...
 
class  TextEntity
 Handle to a Text entity. More...
 
struct  TextInfo
 Static description of a text entity. More...
 
class  TextSensorEntity
 Handle to a TextSensor entity. More...
 
struct  TextSensorInfo
 Static description of a text sensor entity. More...
 
struct  TextSensorState
 A text sensor's reported value. More...
 
struct  TextState
 A text entity's reported value. More...
 
struct  TimeCommand
 A command to set a time's value. More...
 
class  TimeEntity
 Handle to a Time entity. More...
 
struct  TimeInfo
 Static description of a time entity. More...
 
class  TimeoutError
 An operation did not complete before its deadline. More...
 
struct  TimeState
 A time's reported value. More...
 
class  ToggleEntity
 Adds on/off helpers. Derived must provide state() (bool state) and set_power(bool). More...
 
class  Transport
 Byte-stream transport: async connect, a continuous read pump and a serialized write queue. More...
 
class  TypedEntity
 Adds the shared EntityInfo accessors, reading from Derived::info(). More...
 
struct  UpdateControl
 A command to control an update entity. More...
 
class  UpdateEntity
 Handle to a Update entity. More...
 
struct  UpdateInfo
 Static description of an update entity. More...
 
struct  UpdateState
 An update's reported value. More...
 
struct  UserService
 A user-defined service advertised by the device (api: api.services). More...
 
struct  UserServiceArg
 One argument of a user-defined service. More...
 
struct  ValveCommand
 A command targeting a valve entity. More...
 
class  ValveEntity
 Handle to a Valve entity. More...
 
struct  ValveInfo
 Static description of a valve entity. More...
 
struct  ValveState
 A valve's reported state. More...
 
class  VoiceAssistant
 Drives the device's voice-assistant pipeline: subscribing to start/stop requests, relaying events and audio, announcing media, and managing the wake-word configuration. More...
 
struct  VoiceAudio
 A chunk of audio streamed over the API (api: VoiceAssistantAudio). More...
 
struct  VoiceAudioSettings
 Audio capture/processing settings the device requests for a pipeline run (api: VoiceAssistantRequest.audio_settings). More...
 
struct  VoiceConfiguration
 The device's voice-assistant configuration (api: VoiceAssistantConfigurationResponse). More...
 
struct  VoiceEvent
 A pipeline event emitted by the device (api: VoiceAssistantEventResponse). More...
 
struct  VoiceRequest
 The device asking the client to start or stop a voice pipeline (api: VoiceAssistantRequest). More...
 
struct  VoiceTimerEvent
 A timer event surfaced by the device (api: VoiceAssistantTimerEventResponse). More...
 
struct  VoiceWakeWord
 A wake word the device can be configured to listen for (api: VoiceAssistantWakeWord). More...
 
struct  WaterHeaterCommand
 A command to mutate a water heater. More...
 
class  WaterHeaterEntity
 Handle to a WaterHeater entity. More...
 
struct  WaterHeaterInfo
 Static description of a water heater entity. More...
 
struct  WaterHeaterState
 A water heater's reported state. More...
 
class  ZWaveProxy
 Bridges raw Z-Wave frames between a client and the device's Z-Wave radio. More...
 
struct  ZWaveProxyFrame
 A raw Z-Wave frame exchanged with the device (api: ZWaveProxyFrame). More...
 

Typedefs

using ByteBuffer = std::vector< std::uint8_t >
 Owning, growable byte buffer.
 
using ServiceValue = std::variant< bool, std::int32_t, float, std::string, std::vector< bool >, std::vector< std::int32_t >, std::vector< float >, std::vector< std::string > >
 A value passed to a service invocation.
 
using TimerId = std::uint64_t
 Opaque handle to a scheduled timer; invalid_timer means "no timer".
 

Enumerations

enum class  VarintStatus { Ok , Incomplete , Overflow }
 Outcome of decoding a varint from a (possibly partial) buffer. More...
 
enum class  ConnectionState {
  Disconnected , Connecting , HelloSent , Connected ,
  Closing , Closed , Failed
}
 Lifecycle of a Connection. More...
 
enum class  FrameStatus { Ok , NeedMore }
 Result of attempting to pull a frame from the reassembly buffer. More...
 
enum class  LockCommand : std::int32_t { Unlock = 0 , Lock = 1 , Open = 2 }
 Mirror of proto enum LockCommand (not present in the generated enums mirror). More...
 
enum class  EntityType {
  Unknown , BinarySensor , Sensor , TextSensor ,
  Switch , Light , Cover , Fan ,
  Climate , Number , Select , Text ,
  Button , Lock , MediaPlayer , Camera ,
  Siren , AlarmControlPanel , Date , Time ,
  DateTime , Valve , Event , Update ,
  WaterHeater , Infrared , RadioFrequency
}
 One per ESPHome entity domain (the <X> in ListEntities<X>Response). More...
 
enum class  SerialProxyPortType : std::int32_t { Ttl = 0 , Rs232 = 1 , Rs485 = 2 }
 Mirror of proto enum SerialProxyPortType. More...
 
enum class  EntityCategory : std::int32_t { None = 0 , Config = 1 , Diagnostic = 2 }
 Mirror of proto enum EntityCategory. More...
 
enum class  LegacyCoverState : std::int32_t { Open = 0 , Closed = 1 }
 Mirror of proto enum LegacyCoverState. More...
 
enum class  CoverOperation : std::int32_t { Idle = 0 , IsOpening = 1 , IsClosing = 2 }
 Mirror of proto enum CoverOperation. More...
 
enum class  LegacyCoverCommand : std::int32_t { Open = 0 , Close = 1 , Stop = 2 }
 Mirror of proto enum LegacyCoverCommand. More...
 
enum class  FanSpeed : std::int32_t { Low = 0 , Medium = 1 , High = 2 }
 Mirror of proto enum FanSpeed. More...
 
enum class  FanDirection : std::int32_t { Forward = 0 , Reverse = 1 }
 Mirror of proto enum FanDirection. More...
 
enum class  ColorMode : std::int32_t {
  Unknown = 0 , OnOff = 1 , LegacyBrightness = 2 , Brightness = 3 ,
  White = 7 , ColorTemperature = 11 , ColdWarmWhite = 19 , Rgb = 35 ,
  RgbWhite = 39 , RgbColorTemperature = 47 , RgbColdWarmWhite = 51
}
 Mirror of proto enum ColorMode. More...
 
enum class  SensorStateClass : std::int32_t {
  None = 0 , Measurement = 1 , TotalIncreasing = 2 , Total = 3 ,
  MeasurementAngle = 4
}
 Mirror of proto enum SensorStateClass. More...
 
enum class  SensorLastResetType : std::int32_t { None = 0 , Never = 1 , Auto = 2 }
 Mirror of proto enum SensorLastResetType. More...
 
enum class  LogLevel : std::int32_t {
  None = 0 , Error = 1 , Warn = 2 , Info = 3 ,
  Config = 4 , Debug = 5 , Verbose = 6 , VeryVerbose = 7
}
 Mirror of proto enum LogLevel. More...
 
enum class  DSTRuleType : std::int32_t { None = 0 , MonthWeekDay = 1 , JulianNoLeap = 2 , DayOfYear = 3 }
 Mirror of proto enum DSTRuleType. More...
 
enum class  ServiceArgType : std::int32_t {
  Bool = 0 , Int = 1 , Float = 2 , String = 3 ,
  BoolArray = 4 , IntArray = 5 , FloatArray = 6 , StringArray = 7
}
 Mirror of proto enum ServiceArgType. More...
 
enum class  SupportsResponseType : std::int32_t { None = 0 , Optional = 1 , Only = 2 , Status = 100 }
 Mirror of proto enum SupportsResponseType. More...
 
enum class  TemperatureUnit : std::int32_t { Celsius = 0 , Fahrenheit = 1 , Kelvin = 2 }
 Mirror of proto enum TemperatureUnit. More...
 
enum class  ClimateMode : std::int32_t {
  Off = 0 , HeatCool = 1 , Cool = 2 , Heat = 3 ,
  FanOnly = 4 , Dry = 5 , Auto = 6
}
 Mirror of proto enum ClimateMode. More...
 
enum class  ClimateFanMode : std::int32_t {
  On = 0 , Off = 1 , Auto = 2 , Low = 3 ,
  Medium = 4 , High = 5 , Middle = 6 , Focus = 7 ,
  Diffuse = 8 , Quiet = 9
}
 Mirror of proto enum ClimateFanMode. More...
 
enum class  ClimateSwingMode : std::int32_t { Off = 0 , Both = 1 , Vertical = 2 , Horizontal = 3 }
 Mirror of proto enum ClimateSwingMode. More...
 
enum class  ClimateAction : std::int32_t {
  Off = 0 , Cooling = 2 , Heating = 3 , Idle = 4 ,
  Drying = 5 , Fan = 6 , Defrosting = 7
}
 Mirror of proto enum ClimateAction. More...
 
enum class  ClimatePreset : std::int32_t {
  None = 0 , Home = 1 , Away = 2 , Boost = 3 ,
  Comfort = 4 , Eco = 5 , Sleep = 6 , Activity = 7
}
 Mirror of proto enum ClimatePreset. More...
 
enum class  WaterHeaterMode : std::int32_t {
  Off = 0 , Eco = 1 , Electric = 2 , Performance = 3 ,
  HighDemand = 4 , HeatPump = 5 , Gas = 6
}
 Mirror of proto enum WaterHeaterMode. More...
 
enum class  WaterHeaterCommandHasField : std::int32_t {
  None = 0 , Mode = 1 , TargetTemperature = 2 , State = 4 ,
  TargetTemperatureLow = 8 , TargetTemperatureHigh = 16 , OnState = 32 , AwayState = 64
}
 Mirror of proto enum WaterHeaterCommandHasField. More...
 
enum class  NumberMode : std::int32_t { Auto = 0 , Box = 1 , Slider = 2 }
 Mirror of proto enum NumberMode. More...
 
enum class  LockState : std::int32_t {
  None = 0 , Locked = 1 , Unlocked = 2 , Jammed = 3 ,
  Locking = 4 , Unlocking = 5 , Opening = 6 , Open = 7
}
 Mirror of proto enum LockState. More...
 
enum class  MediaPlayerState : std::int32_t {
  None = 0 , Idle = 1 , Playing = 2 , Paused = 3 ,
  Announcing = 4 , Off = 5 , On = 6
}
 Mirror of proto enum MediaPlayerState. More...
 
enum class  MediaPlayerCommand : std::int32_t {
  Play = 0 , Pause = 1 , Stop = 2 , Mute = 3 ,
  Unmute = 4 , Toggle = 5 , VolumeUp = 6 , VolumeDown = 7 ,
  Enqueue = 8 , RepeatOne = 9 , RepeatOff = 10 , ClearPlaylist = 11 ,
  TurnOn = 12 , TurnOff = 13
}
 Mirror of proto enum MediaPlayerCommand. More...
 
enum class  MediaPlayerFormatPurpose : std::int32_t { Default = 0 , Announcement = 1 }
 Mirror of proto enum MediaPlayerFormatPurpose. More...
 
enum class  BluetoothDeviceRequestType : std::int32_t {
  Connect = 0 , Disconnect = 1 , Pair = 2 , Unpair = 3 ,
  ConnectV3WithCache = 4 , ConnectV3WithoutCache = 5 , ClearCache = 6
}
 Mirror of proto enum BluetoothDeviceRequestType. More...
 
enum class  BluetoothScannerState : std::int32_t {
  Idle = 0 , Starting = 1 , Running = 2 , Failed = 3 ,
  Stopping = 4 , Stopped = 5
}
 Mirror of proto enum BluetoothScannerState. More...
 
enum class  BluetoothScannerMode : std::int32_t { Passive = 0 , Active = 1 }
 Mirror of proto enum BluetoothScannerMode. More...
 
enum class  VoiceAssistantSubscribeFlag : std::int32_t { None = 0 , ApiAudio = 1 }
 Mirror of proto enum VoiceAssistantSubscribeFlag. More...
 
enum class  VoiceAssistantRequestFlag : std::int32_t { None = 0 , UseVad = 1 , UseWakeWord = 2 }
 Mirror of proto enum VoiceAssistantRequestFlag. More...
 
enum class  VoiceAssistantEvent : std::int32_t {
  Error = 0 , RunStart = 1 , RunEnd = 2 , SttStart = 3 ,
  SttEnd = 4 , IntentStart = 5 , IntentEnd = 6 , TtsStart = 7 ,
  TtsEnd = 8 , WakeWordStart = 9 , WakeWordEnd = 10 , SttVadStart = 11 ,
  SttVadEnd = 12 , TtsStreamStart = 98 , TtsStreamEnd = 99 , IntentProgress = 100
}
 Mirror of proto enum VoiceAssistantEvent. More...
 
enum class  VoiceAssistantTimerEvent : std::int32_t { Started = 0 , Updated = 1 , Cancelled = 2 , Finished = 3 }
 Mirror of proto enum VoiceAssistantTimerEvent. More...
 
enum class  AlarmControlPanelState : std::int32_t {
  Disarmed = 0 , ArmedHome = 1 , ArmedAway = 2 , ArmedNight = 3 ,
  ArmedVacation = 4 , ArmedCustomBypass = 5 , Pending = 6 , Arming = 7 ,
  Disarming = 8 , Triggered = 9
}
 Mirror of proto enum AlarmControlPanelState. More...
 
enum class  AlarmControlPanelStateCommand : std::int32_t {
  Disarm = 0 , ArmAway = 1 , ArmHome = 2 , ArmNight = 3 ,
  ArmVacation = 4 , ArmCustomBypass = 5 , Trigger = 6
}
 Mirror of proto enum AlarmControlPanelStateCommand. More...
 
enum class  TextMode : std::int32_t { Text = 0 , Password = 1 }
 Mirror of proto enum TextMode. More...
 
enum class  ValveOperation : std::int32_t { Idle = 0 , IsOpening = 1 , IsClosing = 2 }
 Mirror of proto enum ValveOperation. More...
 
enum class  UpdateCommand : std::int32_t { None = 0 , Update = 1 , Check = 2 }
 Mirror of proto enum UpdateCommand. More...
 
enum class  ZWaveProxyRequestType : std::int32_t { Subscribe = 0 , Unsubscribe = 1 , HomeIdChange = 2 }
 Mirror of proto enum ZWaveProxyRequestType. More...
 
enum class  SerialProxyParity : std::int32_t { None = 0 , Even = 1 , Odd = 2 }
 Mirror of proto enum SerialProxyParity. More...
 
enum class  SerialProxyRequestType : std::int32_t { Subscribe = 0 , Unsubscribe = 1 , Flush = 2 }
 Mirror of proto enum SerialProxyRequestType. More...
 
enum class  SerialProxyStatus : std::int32_t {
  Ok = 0 , AssumedSuccess = 1 , Error = 2 , Timeout = 3 ,
  NotSupported = 4
}
 Mirror of proto enum SerialProxyStatus. More...
 
enum class  WireType : std::uint8_t { Varint = 0 , Fixed64 = 1 , LengthDelimited = 2 , Fixed32 = 5 }
 Protobuf wire types (the low 3 bits of a field tag). More...
 

Functions

std::size_t varint_size (std::uint32_t value) noexcept
 Number of bytes the base-128 encoding of value occupies.
 
void append_varint (ByteBuffer &out, std::uint32_t value)
 Append the base-128 varint encoding of value to out.
 
VarintStatus decode_varint (const std::uint8_t *data, std::size_t len, std::uint32_t &value, std::size_t &consumed, std::size_t max_bytes=max_varint_bytes) noexcept
 Decode a base-128 varint from [data, data+len).
 
void request_camera_image (const Client &client, bool single, bool stream)
 Request a camera still image (single) or start/stop a stream.
 
void send_command (const Client &client, const SwitchCommand &cmd)
 Send a SwitchCommand to the device.
 
void send_command (const Client &client, const ButtonCommand &cmd)
 Send a ButtonCommand to the device.
 
void send_command (const Client &client, const NumberCommand &cmd)
 Send a NumberCommand to the device.
 
void send_command (const Client &client, const SelectCommand &cmd)
 Send a SelectCommand to the device.
 
void send_command (const Client &client, const TextCommand &cmd)
 Send a TextCommand to the device.
 
void send_command (const Client &client, const LightCommand &cmd)
 Send a LightCommand to the device.
 
void send_command (const Client &client, const FanCommand &cmd)
 Send a FanCommand to the device.
 
void send_command (const Client &client, const CoverCommand &cmd)
 Send a CoverCommand to the device.
 
void send_command (const Client &client, const ValveCommand &cmd)
 Send a ValveCommand to the device.
 
void send_command (const Client &client, const LockCommandData &cmd)
 Send a LockCommandData to the device.
 
void send_command (const Client &client, const SirenCommand &cmd)
 Send a SirenCommand to the device.
 
void send_command (const Client &client, const ClimateCommand &cmd)
 Send a ClimateCommand to the device.
 
void send_command (const Client &client, const WaterHeaterCommand &cmd)
 Send a WaterHeaterCommand to the device.
 
void send_command (const Client &client, const MediaPlayerControl &cmd)
 Send a MediaPlayerControl to the device.
 
void send_command (const Client &client, const AlarmControlPanelCommand &cmd)
 Send a AlarmControlPanelCommand to the device.
 
void send_command (const Client &client, const DateCommand &cmd)
 Send a DateCommand to the device.
 
void send_command (const Client &client, const TimeCommand &cmd)
 Send a TimeCommand to the device.
 
void send_command (const Client &client, const DateTimeCommand &cmd)
 Send a DateTimeCommand to the device.
 
void send_command (const Client &client, const UpdateControl &cmd)
 Send a UpdateControl to the device.
 
const char * to_string (const ConnectionState state)
 Human-readable name of a connection state.
 
std::vector< DiscoveredDeviceparse_mdns_packets (const std::vector< ByteBuffer > &packets)
 Parse raw mDNS response packets into devices.
 
AlarmControlPanelInfo parse_alarm_control_panel_info (const proto::ListEntitiesAlarmControlPanelResponse &msg)
 
AlarmControlPanelStatus parse_alarm_control_panel_state (const proto::AlarmControlPanelStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const AlarmControlPanelCommand &cmd)
 
BinarySensorInfo parse_binary_sensor_info (const proto::ListEntitiesBinarySensorResponse &msg)
 
BinarySensorState parse_binary_sensor_state (const proto::BinarySensorStateResponse &msg)
 
ButtonInfo parse_button_info (const proto::ListEntitiesButtonResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const ButtonCommand &cmd)
 
CameraInfo parse_camera_info (const proto::ListEntitiesCameraResponse &msg)
 
ClimateInfo parse_climate_info (const proto::ListEntitiesClimateResponse &msg)
 
ClimateState parse_climate_state (const proto::ClimateStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const ClimateCommand &cmd)
 
CoverInfo parse_cover_info (const proto::ListEntitiesCoverResponse &msg)
 
CoverState parse_cover_state (const proto::CoverStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const CoverCommand &cmd)
 
DateInfo parse_date_info (const proto::ListEntitiesDateResponse &msg)
 
DateState parse_date_state (const proto::DateStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const DateCommand &cmd)
 
DateTimeInfo parse_datetime_info (const proto::ListEntitiesDateTimeResponse &msg)
 
DateTimeState parse_datetime_state (const proto::DateTimeStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const DateTimeCommand &cmd)
 
EventInfo parse_event_info (const proto::ListEntitiesEventResponse &msg)
 
EventState parse_event_state (const proto::EventResponse &msg)
 
FanInfo parse_fan_info (const proto::ListEntitiesFanResponse &msg)
 
FanState parse_fan_state (const proto::FanStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const FanCommand &cmd)
 
InfraredInfo parse_infrared_info (const proto::ListEntitiesInfraredResponse &msg)
 
LightInfo parse_light_info (const proto::ListEntitiesLightResponse &msg)
 
LightState parse_light_state (const proto::LightStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const LightCommand &cmd)
 
LockInfo parse_lock_info (const proto::ListEntitiesLockResponse &msg)
 
LockEntityState parse_lock_state (const proto::LockStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const LockCommandData &cmd)
 
MediaPlayerInfo parse_media_player_info (const proto::ListEntitiesMediaPlayerResponse &msg)
 
MediaPlayerStatus parse_media_player_state (const proto::MediaPlayerStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const MediaPlayerControl &cmd)
 
NumberInfo parse_number_info (const proto::ListEntitiesNumberResponse &msg)
 
NumberState parse_number_state (const proto::NumberStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const NumberCommand &cmd)
 
RadioFrequencyInfo parse_radio_frequency_info (const proto::ListEntitiesRadioFrequencyResponse &msg)
 
SelectInfo parse_select_info (const proto::ListEntitiesSelectResponse &msg)
 
SelectState parse_select_state (const proto::SelectStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const SelectCommand &cmd)
 
SensorInfo parse_sensor_info (const proto::ListEntitiesSensorResponse &msg)
 
SensorState parse_sensor_state (const proto::SensorStateResponse &msg)
 
SirenInfo parse_siren_info (const proto::ListEntitiesSirenResponse &msg)
 
SirenState parse_siren_state (const proto::SirenStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const SirenCommand &cmd)
 
SwitchInfo parse_switch_info (const proto::ListEntitiesSwitchResponse &msg)
 
SwitchState parse_switch_state (const proto::SwitchStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const SwitchCommand &cmd)
 
TextInfo parse_text_info (const proto::ListEntitiesTextResponse &msg)
 
TextState parse_text_state (const proto::TextStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const TextCommand &cmd)
 
TextSensorInfo parse_text_sensor_info (const proto::ListEntitiesTextSensorResponse &msg)
 
TextSensorState parse_text_sensor_state (const proto::TextSensorStateResponse &msg)
 
TimeInfo parse_time_info (const proto::ListEntitiesTimeResponse &msg)
 
TimeState parse_time_state (const proto::TimeStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const TimeCommand &cmd)
 
UpdateInfo parse_update_info (const proto::ListEntitiesUpdateResponse &msg)
 
UpdateState parse_update_state (const proto::UpdateStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const UpdateControl &cmd)
 
ValveInfo parse_valve_info (const proto::ListEntitiesValveResponse &msg)
 
ValveState parse_valve_state (const proto::ValveStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const ValveCommand &cmd)
 
WaterHeaterInfo parse_water_heater_info (const proto::ListEntitiesWaterHeaterResponse &msg)
 
WaterHeaterState parse_water_heater_state (const proto::WaterHeaterStateResponse &msg)
 
std::unique_ptr< ProtoMessageto_message (const WaterHeaterCommand &cmd)
 
const char * entity_type_name (EntityType type)
 Domain name, e.g. EntityType::BinarySensor -> "BinarySensor".
 
EntityType entity_type_from_token (const std::string &token)
 Parse the <X> token from a message name (e.g.
 
std::uint32_t zigzag_encode32 (const std::int32_t v)
 
std::int32_t zigzag_decode32 (const std::uint32_t v)
 
std::uint64_t zigzag_encode64 (const std::int64_t v)
 
std::int64_t zigzag_decode64 (const std::uint64_t v)
 
std::size_t varint_size (std::uint64_t v)
 Number of bytes a value occupies as a base-128 varint.
 
std::size_t tag_size (const std::uint32_t field_number)
 Number of bytes the tag for field_number occupies (wire type does not change the byte count — it only fills the low 3 bits).
 
std::uint32_t float_to_bits (const float f)
 
float bits_to_float (const std::uint32_t bits)
 
std::uint64_t double_to_bits (const double d)
 
double bits_to_double (const std::uint64_t bits)
 

Variables

constexpr std::size_t max_varint_bytes = 5
 Maximum number of bytes a base-128 varint may occupy for a 32-bit value.
 
constexpr bool noise_supported = false
 True when the library was built with Noise (encrypted-transport) support.
 
constexpr unsigned default_port = 6053
 Default TCP port of the ESPHome native API.
 
constexpr std::size_t max_frame_payload = std::size_t{16} * 1024 * 1024
 Hard upper bound on a single frame's payload, guarding against a hostile or corrupt length prefix (16 MiB — comfortably above camera/BLE batches).
 
constexpr TimerId invalid_timer = 0
 

Typedef Documentation

◆ ByteBuffer

using esphome::api::ByteBuffer = typedef std::vector<std::uint8_t>

Owning, growable byte buffer.

◆ ServiceValue

using esphome::api::ServiceValue = typedef std::variant<bool, std::int32_t, float, std::string, std::vector<bool>, std::vector<std::int32_t>, std::vector<float>, std::vector<std::string> >

A value passed to a service invocation.

The active alternative must match the corresponding argument's declared type.

◆ TimerId

using esphome::api::TimerId = typedef std::uint64_t

Opaque handle to a scheduled timer; invalid_timer means "no timer".

Enumeration Type Documentation

◆ AlarmControlPanelState

enum class esphome::api::AlarmControlPanelState : std::int32_t
strong

Mirror of proto enum AlarmControlPanelState.

Enumerator
Disarmed 
ArmedHome 
ArmedAway 
ArmedNight 
ArmedVacation 
ArmedCustomBypass 
Pending 
Arming 
Disarming 
Triggered 

◆ AlarmControlPanelStateCommand

enum class esphome::api::AlarmControlPanelStateCommand : std::int32_t
strong

Mirror of proto enum AlarmControlPanelStateCommand.

Enumerator
Disarm 
ArmAway 
ArmHome 
ArmNight 
ArmVacation 
ArmCustomBypass 
Trigger 

◆ BluetoothDeviceRequestType

enum class esphome::api::BluetoothDeviceRequestType : std::int32_t
strong

Mirror of proto enum BluetoothDeviceRequestType.

Enumerator
Connect 
Disconnect 
Pair 
Unpair 
ConnectV3WithCache 
ConnectV3WithoutCache 
ClearCache 

◆ BluetoothScannerMode

enum class esphome::api::BluetoothScannerMode : std::int32_t
strong

Mirror of proto enum BluetoothScannerMode.

Enumerator
Passive 
Active 

◆ BluetoothScannerState

enum class esphome::api::BluetoothScannerState : std::int32_t
strong

Mirror of proto enum BluetoothScannerState.

Enumerator
Idle 
Starting 
Running 
Failed 
Stopping 
Stopped 

◆ ClimateAction

enum class esphome::api::ClimateAction : std::int32_t
strong

Mirror of proto enum ClimateAction.

Enumerator
Off 
Cooling 
Heating 
Idle 
Drying 
Fan 
Defrosting 

◆ ClimateFanMode

enum class esphome::api::ClimateFanMode : std::int32_t
strong

Mirror of proto enum ClimateFanMode.

Enumerator
On 
Off 
Auto 
Low 
Medium 
High 
Middle 
Focus 
Diffuse 
Quiet 

◆ ClimateMode

enum class esphome::api::ClimateMode : std::int32_t
strong

Mirror of proto enum ClimateMode.

Enumerator
Off 
HeatCool 
Cool 
Heat 
FanOnly 
Dry 
Auto 

◆ ClimatePreset

enum class esphome::api::ClimatePreset : std::int32_t
strong

Mirror of proto enum ClimatePreset.

Enumerator
None 
Home 
Away 
Boost 
Comfort 
Eco 
Sleep 
Activity 

◆ ClimateSwingMode

enum class esphome::api::ClimateSwingMode : std::int32_t
strong

Mirror of proto enum ClimateSwingMode.

Enumerator
Off 
Both 
Vertical 
Horizontal 

◆ ColorMode

enum class esphome::api::ColorMode : std::int32_t
strong

Mirror of proto enum ColorMode.

Enumerator
Unknown 
OnOff 
LegacyBrightness 
Brightness 
White 
ColorTemperature 
ColdWarmWhite 
Rgb 
RgbWhite 
RgbColorTemperature 
RgbColdWarmWhite 

◆ ConnectionState

enum class esphome::api::ConnectionState
strong

Lifecycle of a Connection.

Transitions are strictly monotonic per attempt: Disconnected → Connecting → HelloSent → Connected → Closing → Closed, with Failed reachable from any active state on error.

Enumerator
Disconnected 

Idle, never connected or fully torn down.

Connecting 

TCP connect (and, for Noise, handshake) in progress.

HelloSent 

HelloRequest sent; awaiting HelloResponse.

Connected 

Handshake complete; messages flow freely.

Closing 

Graceful DisconnectRequest in flight.

Closed 

Cleanly closed.

Failed 

Terminated by an error.

◆ CoverOperation

enum class esphome::api::CoverOperation : std::int32_t
strong

Mirror of proto enum CoverOperation.

Enumerator
Idle 
IsOpening 
IsClosing 

◆ DSTRuleType

enum class esphome::api::DSTRuleType : std::int32_t
strong

Mirror of proto enum DSTRuleType.

Enumerator
None 
MonthWeekDay 
JulianNoLeap 
DayOfYear 

◆ EntityCategory

enum class esphome::api::EntityCategory : std::int32_t
strong

Mirror of proto enum EntityCategory.

Enumerator
None 
Config 
Diagnostic 

◆ EntityType

enum class esphome::api::EntityType
strong

One per ESPHome entity domain (the <X> in ListEntities<X>Response).

Enumerator
Unknown 
BinarySensor 
Sensor 
TextSensor 
Switch 
Light 
Cover 
Fan 
Climate 
Number 
Select 
Text 
Button 
Lock 
MediaPlayer 
Camera 
Siren 
AlarmControlPanel 
Date 
Time 
DateTime 
Valve 
Event 
Update 
WaterHeater 
Infrared 
RadioFrequency 

◆ FanDirection

enum class esphome::api::FanDirection : std::int32_t
strong

Mirror of proto enum FanDirection.

Enumerator
Forward 
Reverse 

◆ FanSpeed

enum class esphome::api::FanSpeed : std::int32_t
strong

Mirror of proto enum FanSpeed.

Enumerator
Low 
Medium 
High 

◆ FrameStatus

enum class esphome::api::FrameStatus
strong

Result of attempting to pull a frame from the reassembly buffer.

Enumerator
Ok 

A complete frame is available in the out-parameters.

NeedMore 

The buffer holds only a partial frame; feed more bytes.

◆ LegacyCoverCommand

enum class esphome::api::LegacyCoverCommand : std::int32_t
strong

Mirror of proto enum LegacyCoverCommand.

Enumerator
Open 
Close 
Stop 

◆ LegacyCoverState

enum class esphome::api::LegacyCoverState : std::int32_t
strong

Mirror of proto enum LegacyCoverState.

Enumerator
Open 
Closed 

◆ LockCommand

enum class esphome::api::LockCommand : std::int32_t
strong

Mirror of proto enum LockCommand (not present in the generated enums mirror).

Enumerator
Unlock 
Lock 
Open 

◆ LockState

enum class esphome::api::LockState : std::int32_t
strong

Mirror of proto enum LockState.

Enumerator
None 
Locked 
Unlocked 
Jammed 
Locking 
Unlocking 
Opening 
Open 

◆ LogLevel

enum class esphome::api::LogLevel : std::int32_t
strong

Mirror of proto enum LogLevel.

Enumerator
None 
Error 
Warn 
Info 
Config 
Debug 
Verbose 
VeryVerbose 

◆ MediaPlayerCommand

enum class esphome::api::MediaPlayerCommand : std::int32_t
strong

Mirror of proto enum MediaPlayerCommand.

Enumerator
Play 
Pause 
Stop 
Mute 
Unmute 
Toggle 
VolumeUp 
VolumeDown 
Enqueue 
RepeatOne 
RepeatOff 
ClearPlaylist 
TurnOn 
TurnOff 

◆ MediaPlayerFormatPurpose

enum class esphome::api::MediaPlayerFormatPurpose : std::int32_t
strong

Mirror of proto enum MediaPlayerFormatPurpose.

Enumerator
Default 
Announcement 

◆ MediaPlayerState

enum class esphome::api::MediaPlayerState : std::int32_t
strong

Mirror of proto enum MediaPlayerState.

Enumerator
None 
Idle 
Playing 
Paused 
Announcing 
Off 
On 

◆ NumberMode

enum class esphome::api::NumberMode : std::int32_t
strong

Mirror of proto enum NumberMode.

Enumerator
Auto 
Box 
Slider 

◆ SensorLastResetType

enum class esphome::api::SensorLastResetType : std::int32_t
strong

Mirror of proto enum SensorLastResetType.

Enumerator
None 
Never 
Auto 

◆ SensorStateClass

enum class esphome::api::SensorStateClass : std::int32_t
strong

Mirror of proto enum SensorStateClass.

Enumerator
None 
Measurement 
TotalIncreasing 
Total 
MeasurementAngle 

◆ SerialProxyParity

enum class esphome::api::SerialProxyParity : std::int32_t
strong

Mirror of proto enum SerialProxyParity.

Enumerator
None 
Even 
Odd 

◆ SerialProxyPortType

enum class esphome::api::SerialProxyPortType : std::int32_t
strong

Mirror of proto enum SerialProxyPortType.

Enumerator
Ttl 
Rs232 
Rs485 

◆ SerialProxyRequestType

enum class esphome::api::SerialProxyRequestType : std::int32_t
strong

Mirror of proto enum SerialProxyRequestType.

Enumerator
Subscribe 
Unsubscribe 
Flush 

◆ SerialProxyStatus

enum class esphome::api::SerialProxyStatus : std::int32_t
strong

Mirror of proto enum SerialProxyStatus.

Enumerator
Ok 
AssumedSuccess 
Error 
Timeout 
NotSupported 

◆ ServiceArgType

enum class esphome::api::ServiceArgType : std::int32_t
strong

Mirror of proto enum ServiceArgType.

Enumerator
Bool 
Int 
Float 
String 
BoolArray 
IntArray 
FloatArray 
StringArray 

◆ SupportsResponseType

enum class esphome::api::SupportsResponseType : std::int32_t
strong

Mirror of proto enum SupportsResponseType.

Enumerator
None 
Optional 
Only 
Status 

◆ TemperatureUnit

enum class esphome::api::TemperatureUnit : std::int32_t
strong

Mirror of proto enum TemperatureUnit.

Enumerator
Celsius 
Fahrenheit 
Kelvin 

◆ TextMode

enum class esphome::api::TextMode : std::int32_t
strong

Mirror of proto enum TextMode.

Enumerator
Text 
Password 

◆ UpdateCommand

enum class esphome::api::UpdateCommand : std::int32_t
strong

Mirror of proto enum UpdateCommand.

Enumerator
None 
Update 
Check 

◆ ValveOperation

enum class esphome::api::ValveOperation : std::int32_t
strong

Mirror of proto enum ValveOperation.

Enumerator
Idle 
IsOpening 
IsClosing 

◆ VarintStatus

enum class esphome::api::VarintStatus
strong

Outcome of decoding a varint from a (possibly partial) buffer.

Enumerator
Ok 

A complete value was decoded.

Incomplete 

The buffer ended mid-varint; read more and retry.

Overflow 

The varint exceeded the permitted byte budget.

◆ VoiceAssistantEvent

enum class esphome::api::VoiceAssistantEvent : std::int32_t
strong

Mirror of proto enum VoiceAssistantEvent.

Enumerator
Error 
RunStart 
RunEnd 
SttStart 
SttEnd 
IntentStart 
IntentEnd 
TtsStart 
TtsEnd 
WakeWordStart 
WakeWordEnd 
SttVadStart 
SttVadEnd 
TtsStreamStart 
TtsStreamEnd 
IntentProgress 

◆ VoiceAssistantRequestFlag

enum class esphome::api::VoiceAssistantRequestFlag : std::int32_t
strong

Mirror of proto enum VoiceAssistantRequestFlag.

Enumerator
None 
UseVad 
UseWakeWord 

◆ VoiceAssistantSubscribeFlag

enum class esphome::api::VoiceAssistantSubscribeFlag : std::int32_t
strong

Mirror of proto enum VoiceAssistantSubscribeFlag.

Enumerator
None 
ApiAudio 

◆ VoiceAssistantTimerEvent

enum class esphome::api::VoiceAssistantTimerEvent : std::int32_t
strong

Mirror of proto enum VoiceAssistantTimerEvent.

Enumerator
Started 
Updated 
Cancelled 
Finished 

◆ WaterHeaterCommandHasField

enum class esphome::api::WaterHeaterCommandHasField : std::int32_t
strong

Mirror of proto enum WaterHeaterCommandHasField.

Enumerator
None 
Mode 
TargetTemperature 
State 
TargetTemperatureLow 
TargetTemperatureHigh 
OnState 
AwayState 

◆ WaterHeaterMode

enum class esphome::api::WaterHeaterMode : std::int32_t
strong

Mirror of proto enum WaterHeaterMode.

Enumerator
Off 
Eco 
Electric 
Performance 
HighDemand 
HeatPump 
Gas 

◆ WireType

enum class esphome::api::WireType : std::uint8_t
strong

Protobuf wire types (the low 3 bits of a field tag).

Enumerator
Varint 

int32/int64/uint32/uint64/sint32/sint64/bool/enum

Fixed64 

fixed64/sfixed64/double

LengthDelimited 

string/bytes/embedded message/packed repeated

Fixed32 

fixed32/sfixed32/float

◆ ZWaveProxyRequestType

enum class esphome::api::ZWaveProxyRequestType : std::int32_t
strong

Mirror of proto enum ZWaveProxyRequestType.

Enumerator
Subscribe 
Unsubscribe 
HomeIdChange 

Function Documentation

◆ append_varint()

void esphome::api::append_varint ( ByteBuffer out,
std::uint32_t  value 
)

Append the base-128 varint encoding of value to out.

◆ bits_to_double()

double esphome::api::bits_to_double ( const std::uint64_t  bits)
inline

◆ bits_to_float()

float esphome::api::bits_to_float ( const std::uint32_t  bits)
inline

◆ decode_varint()

VarintStatus esphome::api::decode_varint ( const std::uint8_t *  data,
std::size_t  len,
std::uint32_t &  value,
std::size_t &  consumed,
std::size_t  max_bytes = max_varint_bytes 
)
noexcept

Decode a base-128 varint from [data, data+len).

On VarintStatus::Ok, value holds the decoded number and consumed the number of bytes read. On Incomplete the buffer is a valid varint prefix. On Overflow more than max_bytes continuation bytes were seen.

◆ double_to_bits()

std::uint64_t esphome::api::double_to_bits ( const double  d)
inline

◆ entity_type_from_token()

EntityType esphome::api::entity_type_from_token ( const std::string &  token)

Parse the <X> token from a message name (e.g.

"BinarySensor") into the enum, or EntityType::Unknown if unrecognised.

◆ entity_type_name()

const char * esphome::api::entity_type_name ( EntityType  type)

Domain name, e.g. EntityType::BinarySensor -> "BinarySensor".

◆ float_to_bits()

std::uint32_t esphome::api::float_to_bits ( const float  f)
inline

◆ parse_alarm_control_panel_info()

AlarmControlPanelInfo esphome::api::parse_alarm_control_panel_info ( const proto::ListEntitiesAlarmControlPanelResponse &  msg)

◆ parse_alarm_control_panel_state()

AlarmControlPanelStatus esphome::api::parse_alarm_control_panel_state ( const proto::AlarmControlPanelStateResponse &  msg)

◆ parse_binary_sensor_info()

BinarySensorInfo esphome::api::parse_binary_sensor_info ( const proto::ListEntitiesBinarySensorResponse &  msg)

◆ parse_binary_sensor_state()

BinarySensorState esphome::api::parse_binary_sensor_state ( const proto::BinarySensorStateResponse &  msg)

◆ parse_button_info()

ButtonInfo esphome::api::parse_button_info ( const proto::ListEntitiesButtonResponse &  msg)

◆ parse_camera_info()

CameraInfo esphome::api::parse_camera_info ( const proto::ListEntitiesCameraResponse &  msg)

◆ parse_climate_info()

ClimateInfo esphome::api::parse_climate_info ( const proto::ListEntitiesClimateResponse &  msg)

◆ parse_climate_state()

ClimateState esphome::api::parse_climate_state ( const proto::ClimateStateResponse &  msg)

◆ parse_cover_info()

CoverInfo esphome::api::parse_cover_info ( const proto::ListEntitiesCoverResponse &  msg)

◆ parse_cover_state()

CoverState esphome::api::parse_cover_state ( const proto::CoverStateResponse &  msg)

◆ parse_date_info()

DateInfo esphome::api::parse_date_info ( const proto::ListEntitiesDateResponse &  msg)

◆ parse_date_state()

DateState esphome::api::parse_date_state ( const proto::DateStateResponse &  msg)

◆ parse_datetime_info()

DateTimeInfo esphome::api::parse_datetime_info ( const proto::ListEntitiesDateTimeResponse &  msg)

◆ parse_datetime_state()

DateTimeState esphome::api::parse_datetime_state ( const proto::DateTimeStateResponse &  msg)

◆ parse_event_info()

EventInfo esphome::api::parse_event_info ( const proto::ListEntitiesEventResponse &  msg)

◆ parse_event_state()

EventState esphome::api::parse_event_state ( const proto::EventResponse &  msg)

◆ parse_fan_info()

FanInfo esphome::api::parse_fan_info ( const proto::ListEntitiesFanResponse &  msg)

◆ parse_fan_state()

FanState esphome::api::parse_fan_state ( const proto::FanStateResponse &  msg)

◆ parse_infrared_info()

InfraredInfo esphome::api::parse_infrared_info ( const proto::ListEntitiesInfraredResponse &  msg)

◆ parse_light_info()

LightInfo esphome::api::parse_light_info ( const proto::ListEntitiesLightResponse &  msg)

◆ parse_light_state()

LightState esphome::api::parse_light_state ( const proto::LightStateResponse &  msg)

◆ parse_lock_info()

LockInfo esphome::api::parse_lock_info ( const proto::ListEntitiesLockResponse &  msg)

◆ parse_lock_state()

LockEntityState esphome::api::parse_lock_state ( const proto::LockStateResponse &  msg)

◆ parse_mdns_packets()

std::vector< DiscoveredDevice > esphome::api::parse_mdns_packets ( const std::vector< ByteBuffer > &  packets)

Parse raw mDNS response packets into devices.

Exposed for testing and reuse; Discovery::scan calls this on the packets it collects.

◆ parse_media_player_info()

MediaPlayerInfo esphome::api::parse_media_player_info ( const proto::ListEntitiesMediaPlayerResponse &  msg)

◆ parse_media_player_state()

MediaPlayerStatus esphome::api::parse_media_player_state ( const proto::MediaPlayerStateResponse &  msg)

◆ parse_number_info()

NumberInfo esphome::api::parse_number_info ( const proto::ListEntitiesNumberResponse &  msg)

◆ parse_number_state()

NumberState esphome::api::parse_number_state ( const proto::NumberStateResponse &  msg)

◆ parse_radio_frequency_info()

RadioFrequencyInfo esphome::api::parse_radio_frequency_info ( const proto::ListEntitiesRadioFrequencyResponse &  msg)

◆ parse_select_info()

SelectInfo esphome::api::parse_select_info ( const proto::ListEntitiesSelectResponse &  msg)

◆ parse_select_state()

SelectState esphome::api::parse_select_state ( const proto::SelectStateResponse &  msg)

◆ parse_sensor_info()

SensorInfo esphome::api::parse_sensor_info ( const proto::ListEntitiesSensorResponse &  msg)

◆ parse_sensor_state()

SensorState esphome::api::parse_sensor_state ( const proto::SensorStateResponse &  msg)

◆ parse_siren_info()

SirenInfo esphome::api::parse_siren_info ( const proto::ListEntitiesSirenResponse &  msg)

◆ parse_siren_state()

SirenState esphome::api::parse_siren_state ( const proto::SirenStateResponse &  msg)

◆ parse_switch_info()

SwitchInfo esphome::api::parse_switch_info ( const proto::ListEntitiesSwitchResponse &  msg)

◆ parse_switch_state()

SwitchState esphome::api::parse_switch_state ( const proto::SwitchStateResponse &  msg)

◆ parse_text_info()

TextInfo esphome::api::parse_text_info ( const proto::ListEntitiesTextResponse &  msg)

◆ parse_text_sensor_info()

TextSensorInfo esphome::api::parse_text_sensor_info ( const proto::ListEntitiesTextSensorResponse &  msg)

◆ parse_text_sensor_state()

TextSensorState esphome::api::parse_text_sensor_state ( const proto::TextSensorStateResponse &  msg)

◆ parse_text_state()

TextState esphome::api::parse_text_state ( const proto::TextStateResponse &  msg)

◆ parse_time_info()

TimeInfo esphome::api::parse_time_info ( const proto::ListEntitiesTimeResponse &  msg)

◆ parse_time_state()

TimeState esphome::api::parse_time_state ( const proto::TimeStateResponse &  msg)

◆ parse_update_info()

UpdateInfo esphome::api::parse_update_info ( const proto::ListEntitiesUpdateResponse &  msg)

◆ parse_update_state()

UpdateState esphome::api::parse_update_state ( const proto::UpdateStateResponse &  msg)

◆ parse_valve_info()

ValveInfo esphome::api::parse_valve_info ( const proto::ListEntitiesValveResponse &  msg)

◆ parse_valve_state()

ValveState esphome::api::parse_valve_state ( const proto::ValveStateResponse &  msg)

◆ parse_water_heater_info()

WaterHeaterInfo esphome::api::parse_water_heater_info ( const proto::ListEntitiesWaterHeaterResponse &  msg)

◆ parse_water_heater_state()

WaterHeaterState esphome::api::parse_water_heater_state ( const proto::WaterHeaterStateResponse &  msg)

◆ request_camera_image()

void esphome::api::request_camera_image ( const Client client,
bool  single,
bool  stream 
)

Request a camera still image (single) or start/stop a stream.

Cameras are addressed globally by the protocol, so no key is needed.

◆ send_command() [1/19]

void esphome::api::send_command ( const Client client,
const AlarmControlPanelCommand cmd 
)

Send a AlarmControlPanelCommand to the device.

◆ send_command() [2/19]

void esphome::api::send_command ( const Client client,
const ButtonCommand cmd 
)

Send a ButtonCommand to the device.

◆ send_command() [3/19]

void esphome::api::send_command ( const Client client,
const ClimateCommand cmd 
)

Send a ClimateCommand to the device.

◆ send_command() [4/19]

void esphome::api::send_command ( const Client client,
const CoverCommand cmd 
)

Send a CoverCommand to the device.

◆ send_command() [5/19]

void esphome::api::send_command ( const Client client,
const DateCommand cmd 
)

Send a DateCommand to the device.

◆ send_command() [6/19]

void esphome::api::send_command ( const Client client,
const DateTimeCommand cmd 
)

Send a DateTimeCommand to the device.

◆ send_command() [7/19]

void esphome::api::send_command ( const Client client,
const FanCommand cmd 
)

Send a FanCommand to the device.

◆ send_command() [8/19]

void esphome::api::send_command ( const Client client,
const LightCommand cmd 
)

Send a LightCommand to the device.

◆ send_command() [9/19]

void esphome::api::send_command ( const Client client,
const LockCommandData cmd 
)

Send a LockCommandData to the device.

◆ send_command() [10/19]

void esphome::api::send_command ( const Client client,
const MediaPlayerControl cmd 
)

Send a MediaPlayerControl to the device.

◆ send_command() [11/19]

void esphome::api::send_command ( const Client client,
const NumberCommand cmd 
)

Send a NumberCommand to the device.

◆ send_command() [12/19]

void esphome::api::send_command ( const Client client,
const SelectCommand cmd 
)

Send a SelectCommand to the device.

◆ send_command() [13/19]

void esphome::api::send_command ( const Client client,
const SirenCommand cmd 
)

Send a SirenCommand to the device.

◆ send_command() [14/19]

void esphome::api::send_command ( const Client client,
const SwitchCommand cmd 
)

Send a SwitchCommand to the device.

◆ send_command() [15/19]

void esphome::api::send_command ( const Client client,
const TextCommand cmd 
)

Send a TextCommand to the device.

◆ send_command() [16/19]

void esphome::api::send_command ( const Client client,
const TimeCommand cmd 
)

Send a TimeCommand to the device.

◆ send_command() [17/19]

void esphome::api::send_command ( const Client client,
const UpdateControl cmd 
)

Send a UpdateControl to the device.

◆ send_command() [18/19]

void esphome::api::send_command ( const Client client,
const ValveCommand cmd 
)

Send a ValveCommand to the device.

◆ send_command() [19/19]

void esphome::api::send_command ( const Client client,
const WaterHeaterCommand cmd 
)

Send a WaterHeaterCommand to the device.

◆ tag_size()

std::size_t esphome::api::tag_size ( const std::uint32_t  field_number)
inline

Number of bytes the tag for field_number occupies (wire type does not change the byte count — it only fills the low 3 bits).

◆ to_message() [1/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const AlarmControlPanelCommand cmd)

◆ to_message() [2/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const ButtonCommand cmd)

◆ to_message() [3/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const ClimateCommand cmd)

◆ to_message() [4/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const CoverCommand cmd)

◆ to_message() [5/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const DateCommand cmd)

◆ to_message() [6/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const DateTimeCommand cmd)

◆ to_message() [7/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const FanCommand cmd)

◆ to_message() [8/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const LightCommand cmd)

◆ to_message() [9/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const LockCommandData cmd)

◆ to_message() [10/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const MediaPlayerControl cmd)

◆ to_message() [11/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const NumberCommand cmd)

◆ to_message() [12/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const SelectCommand cmd)

◆ to_message() [13/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const SirenCommand cmd)

◆ to_message() [14/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const SwitchCommand cmd)

◆ to_message() [15/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const TextCommand cmd)

◆ to_message() [16/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const TimeCommand cmd)

◆ to_message() [17/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const UpdateControl cmd)

◆ to_message() [18/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const ValveCommand cmd)

◆ to_message() [19/19]

std::unique_ptr< ProtoMessage > esphome::api::to_message ( const WaterHeaterCommand cmd)

◆ to_string()

const char * esphome::api::to_string ( const ConnectionState  state)
inline

Human-readable name of a connection state.

◆ varint_size() [1/2]

std::size_t esphome::api::varint_size ( std::uint32_t  value)
noexcept

Number of bytes the base-128 encoding of value occupies.

◆ varint_size() [2/2]

std::size_t esphome::api::varint_size ( std::uint64_t  v)
inline

Number of bytes a value occupies as a base-128 varint.

◆ zigzag_decode32()

std::int32_t esphome::api::zigzag_decode32 ( const std::uint32_t  v)
inline

◆ zigzag_decode64()

std::int64_t esphome::api::zigzag_decode64 ( const std::uint64_t  v)
inline

◆ zigzag_encode32()

std::uint32_t esphome::api::zigzag_encode32 ( const std::int32_t  v)
inline

◆ zigzag_encode64()

std::uint64_t esphome::api::zigzag_encode64 ( const std::int64_t  v)
inline

Variable Documentation

◆ default_port

constexpr unsigned esphome::api::default_port = 6053
inlineconstexpr

Default TCP port of the ESPHome native API.

◆ invalid_timer

constexpr TimerId esphome::api::invalid_timer = 0
inlineconstexpr

◆ max_frame_payload

constexpr std::size_t esphome::api::max_frame_payload = std::size_t{16} * 1024 * 1024
inlineconstexpr

Hard upper bound on a single frame's payload, guarding against a hostile or corrupt length prefix (16 MiB — comfortably above camera/BLE batches).

◆ max_varint_bytes

constexpr std::size_t esphome::api::max_varint_bytes = 5
inlineconstexpr

Maximum number of bytes a base-128 varint may occupy for a 32-bit value.

◆ noise_supported

constexpr bool esphome::api::noise_supported = false
inlineconstexpr

True when the library was built with Noise (encrypted-transport) support.

Controlled by the CMake option ESPHOME_API_WITH_NOISE, which defines the ESPHOME_API_HAS_NOISE macro on the library target.