esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
zwave_proxy.hpp
Go to the documentation of this file.
1#pragma once
2
5
8
9#include <functional>
10#include <string>
11
12namespace esphome::api {
13
16 std::string data;
17};
18
20class ZWaveProxy : public Subsystem {
21public:
22 using FrameHandler = std::function<void(const ZWaveProxyFrame&)>;
23
24 explicit ZWaveProxy(Client& client) : Subsystem(client) {}
25
27 void on_frame(FrameHandler handler);
28
30 void send_frame(const std::string& data) const;
31
34 void request(ZWaveProxyRequestType type, const std::string& data = {}) const;
35
36private:
37 FrameHandler frame_handler_;
38};
39
40} // namespace esphome::api
Async client for a single device.
Definition client.hpp:38
Shared base for the subsystems exposed by Client (log streaming, the various proxies,...
Definition subsystem.hpp:18
Bridges raw Z-Wave frames between a client and the device's Z-Wave radio.
Definition zwave_proxy.hpp:20
ZWaveProxy(Client &client)
Definition zwave_proxy.hpp:24
std::function< void(const ZWaveProxyFrame &)> FrameHandler
Definition zwave_proxy.hpp:22
void request(ZWaveProxyRequestType type, const std::string &data={}) const
Issue a proxy control request (subscribe, unsubscribe, home id change).
void send_frame(const std::string &data) const
Send a raw Z-Wave frame to the device.
void on_frame(FrameHandler handler)
Register a callback fired for each incoming ZWaveProxyFrame.
Typed mirrors of the ESPHome protobuf enums.
Definition bytes.hpp:10
ZWaveProxyRequestType
Mirror of proto enum ZWaveProxyRequestType.
Definition enums.hpp:384
A raw Z-Wave frame exchanged with the device (api: ZWaveProxyFrame).
Definition zwave_proxy.hpp:15
std::string data
Definition zwave_proxy.hpp:16
Common base for the Client-owned subsystems.