Create Protobuf Plugin for automatically generating native API stubs (#633)

* Create Protobuf Plugin for automatically generating native API stubs

* Format

* Delete api.proto

* Cleanup, use no_delay conditionally

* Updates

* Update

* Lint

* Lint

* Fixes

* Camera

* CustomAPIDevice

* Fix negative VarInt, Add User-defined services arrays

* Home Assistant Event

* Fixes

* Update custom_api_device.h
This commit is contained in:
Otto Winter
2019-06-18 19:31:22 +02:00
committed by GitHub
parent fc465d6d93
commit 369d175694
47 changed files with 7183 additions and 3110 deletions
@@ -22,19 +22,5 @@ void HomeassistantTime::setup() {
HomeassistantTime *global_homeassistant_time = nullptr;
bool GetTimeResponse::decode_32bit(uint32_t field_id, uint32_t value) {
switch (field_id) {
case 1:
// fixed32 epoch_seconds = 1;
if (global_homeassistant_time != nullptr) {
global_homeassistant_time->set_epoch_time(value);
}
return true;
default:
return false;
}
}
api::APIMessageType GetTimeResponse::message_type() const { return api::APIMessageType::GET_TIME_RESPONSE; }
} // namespace homeassistant
} // namespace esphome
@@ -17,11 +17,5 @@ class HomeassistantTime : public time::RealTimeClock {
extern HomeassistantTime *global_homeassistant_time;
class GetTimeResponse : public api::APIMessage {
public:
bool decode_32bit(uint32_t field_id, uint32_t value) override;
api::APIMessageType message_type() const override;
};
} // namespace homeassistant
} // namespace esphome