mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	[api] Fix missing ifdef guards for field_ifdef fields in protobuf base classes (#9693)
This commit is contained in:
		| @@ -301,8 +301,10 @@ class APIConnection : public APIServerConnection { | ||||
|     if (entity->has_own_name()) | ||||
|       msg.name = entity->get_name(); | ||||
|  | ||||
|     // Set common EntityBase properties | ||||
|       // Set common EntityBase properties | ||||
| #ifdef USE_ENTITY_ICON | ||||
|     msg.icon = entity->get_icon(); | ||||
| #endif | ||||
|     msg.disabled_by_default = entity->is_disabled_by_default(); | ||||
|     msg.entity_category = static_cast<enums::EntityCategory>(entity->get_entity_category()); | ||||
| #ifdef USE_DEVICES | ||||
|   | ||||
| @@ -292,9 +292,13 @@ class InfoResponseProtoMessage : public ProtoMessage { | ||||
|   uint32_t key{0}; | ||||
|   std::string name{}; | ||||
|   bool disabled_by_default{false}; | ||||
| #ifdef USE_ENTITY_ICON | ||||
|   std::string icon{}; | ||||
| #endif | ||||
|   enums::EntityCategory entity_category{}; | ||||
| #ifdef USE_DEVICES | ||||
|   uint32_t device_id{0}; | ||||
| #endif | ||||
|  | ||||
|  protected: | ||||
| }; | ||||
| @@ -303,7 +307,9 @@ class StateResponseProtoMessage : public ProtoMessage { | ||||
|  public: | ||||
|   ~StateResponseProtoMessage() override = default; | ||||
|   uint32_t key{0}; | ||||
| #ifdef USE_DEVICES | ||||
|   uint32_t device_id{0}; | ||||
| #endif | ||||
|  | ||||
|  protected: | ||||
| }; | ||||
| @@ -312,7 +318,9 @@ class CommandProtoMessage : public ProtoDecodableMessage { | ||||
|  public: | ||||
|   ~CommandProtoMessage() override = default; | ||||
|   uint32_t key{0}; | ||||
| #ifdef USE_DEVICES | ||||
|   uint32_t device_id{0}; | ||||
| #endif | ||||
|  | ||||
|  protected: | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user