mirror of
https://github.com/esphome/esphome.git
synced 2025-09-15 09:42:19 +01:00
[api] Add new flag to request state/attribute once from HA only (#7258)
This commit is contained in:
@@ -112,10 +112,13 @@ class APIServer : public Component, public Controller {
|
||||
std::string entity_id;
|
||||
optional<std::string> attribute;
|
||||
std::function<void(std::string)> callback;
|
||||
bool once;
|
||||
};
|
||||
|
||||
void subscribe_home_assistant_state(std::string entity_id, optional<std::string> attribute,
|
||||
std::function<void(std::string)> f);
|
||||
void get_home_assistant_state(std::string entity_id, optional<std::string> attribute,
|
||||
std::function<void(std::string)> f);
|
||||
const std::vector<HomeAssistantStateSubscription> &get_state_subs() const;
|
||||
const std::vector<UserServiceDescriptor *> &get_user_services() const { return this->user_services_; }
|
||||
|
||||
|
Reference in New Issue
Block a user