Originally extracted from the Mitsubishi ITP ESPHome component, this library's goal is to abstract the handling of ITP packets' inner workings and quirks to allow components to focus on the high-level meaning of each packet (i.e. providing functions and enums instead of requiring direct byte manipulation).
In the Mitsubishi ITP ESPHome component this library is primarily used by:
- Using the RawPacket constructor to create a RawPacket from an array of bytes.
- Using specific Packet constructors to wrap the RawPacket with useful functions.
- Implementing the PacketProcessor interface to easily handle incoming packets.
To include in your custom component, you can use:
async def to_code(config):
cg.add_library(
name="itp-packet",
repository="https://github.com/muart-group/itp-packet.git",
version="main"
)
To include in your config from the GitHub repo, use:
esphome:
...
libraries:
- itp-packet=https://github.com/muart-group/itp-packet.git#main
For local development you can include the path to this repo locally using ESPHome config:
esphome:
...
libraries:
- itp-packet=file:///workspaces/itp-packet