esphome / aioesphomeapi

Python Client for ESPHome native API. Used by Home Assistant.

Home Page:https://esphome.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aioesphomeapi

image

image

image

aioesphomeapi allows you to interact with devices flashed with ESPHome.

Installation

The module is available from the Python Package Index.

An optional cython extension is available for better performance, and the module will try to build it automatically.

The extension requires a C compiler and Python development headers. The module will fall back to the pure Python implementation if they are unavailable.

Building the extension can be forcefully disabled by setting the environment variable SKIP_CYTHON to 1.

Usage

It's required that you enable the Native API component for the device.

Check the output to get the local address of the device or use the name:under esphome: from the device configuration.

The sample code below will connect to the device and retrieve details.

Subscribe to state changes of an ESPHome device.

Other examples:

Development

For development is recommended to use a Python virtual environment (venv).

A cli tool is also available for watching logs:

A cli tool is also available to discover devices:

License

aioesphomeapi is licensed under MIT, for more details check LICENSE.

About

Python Client for ESPHome native API. Used by Home Assistant.

https://esphome.io/

License:MIT License


Languages

Language:Python 97.8%Language:Cython 1.8%Language:Dockerfile 0.3%Language:Shell 0.0%