mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-28 16:58:27 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user