mirror of
https://github.com/esphome/esphome.git
synced 2025-09-09 23:02:23 +01:00
Add device_id to entity state messages for sub-device support (#9304)
This commit is contained in:
@@ -850,6 +850,11 @@ void BinarySensorStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" missing_state: ");
|
||||
out.append(YESNO(this->missing_state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
#endif
|
||||
@@ -937,6 +942,11 @@ void CoverStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" current_operation: ");
|
||||
out.append(proto_enum_to_string<enums::CoverOperation>(this->current_operation));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void CoverCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -1073,6 +1083,11 @@ void FanStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" preset_mode: ");
|
||||
out.append("'").append(this->preset_mode).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void FanCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -1275,6 +1290,11 @@ void LightStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" effect: ");
|
||||
out.append("'").append(this->effect).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void LightCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -1482,6 +1502,11 @@ void SensorStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" missing_state: ");
|
||||
out.append(YESNO(this->missing_state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
#endif
|
||||
@@ -1543,6 +1568,11 @@ void SwitchStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" state: ");
|
||||
out.append(YESNO(this->state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void SwitchCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -1617,6 +1647,11 @@ void TextSensorStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" missing_state: ");
|
||||
out.append(YESNO(this->missing_state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
#endif
|
||||
@@ -2122,6 +2157,11 @@ void ClimateStateResponse::dump_to(std::string &out) const {
|
||||
sprintf(buffer, "%g", this->target_humidity);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void ClimateCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -2308,6 +2348,11 @@ void NumberStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" missing_state: ");
|
||||
out.append(YESNO(this->missing_state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void NumberCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -2385,6 +2430,11 @@ void SelectStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" missing_state: ");
|
||||
out.append(YESNO(this->missing_state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void SelectCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -2465,6 +2515,11 @@ void SirenStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" state: ");
|
||||
out.append(YESNO(this->state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void SirenCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -2577,6 +2632,11 @@ void LockStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" state: ");
|
||||
out.append(proto_enum_to_string<enums::LockState>(this->state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void LockCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -2750,6 +2810,11 @@ void MediaPlayerStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" muted: ");
|
||||
out.append(YESNO(this->muted));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void MediaPlayerCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -3595,6 +3660,11 @@ void AlarmControlPanelStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" state: ");
|
||||
out.append(proto_enum_to_string<enums::AlarmControlPanelState>(this->state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void AlarmControlPanelCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -3687,6 +3757,11 @@ void TextStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" missing_state: ");
|
||||
out.append(YESNO(this->missing_state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void TextCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -3768,6 +3843,11 @@ void DateStateResponse::dump_to(std::string &out) const {
|
||||
sprintf(buffer, "%" PRIu32, this->day);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void DateCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -3860,6 +3940,11 @@ void TimeStateResponse::dump_to(std::string &out) const {
|
||||
sprintf(buffer, "%" PRIu32, this->second);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void TimeCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -3947,6 +4032,11 @@ void EventResponse::dump_to(std::string &out) const {
|
||||
out.append(" event_type: ");
|
||||
out.append("'").append(this->event_type).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
#endif
|
||||
@@ -4021,6 +4111,11 @@ void ValveStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" current_operation: ");
|
||||
out.append(proto_enum_to_string<enums::ValveOperation>(this->current_operation));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void ValveCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -4101,6 +4196,11 @@ void DateTimeStateResponse::dump_to(std::string &out) const {
|
||||
sprintf(buffer, "%" PRIu32, this->epoch_seconds);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void DateTimeCommandRequest::dump_to(std::string &out) const {
|
||||
@@ -4205,6 +4305,11 @@ void UpdateStateResponse::dump_to(std::string &out) const {
|
||||
out.append(" release_url: ");
|
||||
out.append("'").append(this->release_url).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" device_id: ");
|
||||
sprintf(buffer, "%" PRIu32, this->device_id);
|
||||
out.append(buffer);
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
void UpdateCommandRequest::dump_to(std::string &out) const {
|
||||
|
Reference in New Issue
Block a user