mirror of
https://github.com/esphome/esphome.git
synced 2025-09-03 11:52:20 +01:00
Add device_id to entity state messages for sub-device support (#9304)
This commit is contained in:
@@ -292,6 +292,9 @@ class APIConnection : public APIServerConnection {
|
||||
// Helper function to fill common entity state fields
|
||||
static void fill_entity_state_base(esphome::EntityBase *entity, StateResponseProtoMessage &response) {
|
||||
response.key = entity->get_object_id_hash();
|
||||
#ifdef USE_DEVICES
|
||||
response.device_id = entity->get_device_id();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Non-template helper to encode any ProtoMessage
|
||||
|
Reference in New Issue
Block a user