Revert "Dont dump legacy fields (#2241)" (#2259)

This reverts commit 97eba1eecc.
This commit is contained in:
Jesse Hills 2021-09-09 09:29:08 +12:00 committed by GitHub
parent e5051eefbc
commit cc52f37933
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 2 deletions

View file

@ -793,6 +793,10 @@ void CoverStateResponse::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
out.append(" legacy_state: ");
out.append(proto_enum_to_string<enums::LegacyCoverState>(this->legacy_state));
out.append("\n");
out.append(" position: "); out.append(" position: ");
sprintf(buffer, "%g", this->position); sprintf(buffer, "%g", this->position);
out.append(buffer); out.append(buffer);
@ -876,6 +880,10 @@ void CoverCommandRequest::dump_to(std::string &out) const {
out.append(YESNO(this->has_legacy_command)); out.append(YESNO(this->has_legacy_command));
out.append("\n"); out.append("\n");
out.append(" legacy_command: ");
out.append(proto_enum_to_string<enums::LegacyCoverCommand>(this->legacy_command));
out.append("\n");
out.append(" has_position: "); out.append(" has_position: ");
out.append(YESNO(this->has_position)); out.append(YESNO(this->has_position));
out.append("\n"); out.append("\n");
@ -1322,6 +1330,22 @@ void ListEntitiesLightResponse::dump_to(std::string &out) const {
out.append("\n"); out.append("\n");
} }
out.append(" legacy_supports_brightness: ");
out.append(YESNO(this->legacy_supports_brightness));
out.append("\n");
out.append(" legacy_supports_rgb: ");
out.append(YESNO(this->legacy_supports_rgb));
out.append("\n");
out.append(" legacy_supports_white_value: ");
out.append(YESNO(this->legacy_supports_white_value));
out.append("\n");
out.append(" legacy_supports_color_temperature: ");
out.append(YESNO(this->legacy_supports_color_temperature));
out.append("\n");
out.append(" min_mireds: "); out.append(" min_mireds: ");
sprintf(buffer, "%g", this->min_mireds); sprintf(buffer, "%g", this->min_mireds);
out.append(buffer); out.append(buffer);
@ -2736,6 +2760,11 @@ void ExecuteServiceArgument::dump_to(std::string &out) const {
out.append(YESNO(this->bool_)); out.append(YESNO(this->bool_));
out.append("\n"); out.append("\n");
out.append(" legacy_int: ");
sprintf(buffer, "%d", this->legacy_int);
out.append(buffer);
out.append("\n");
out.append(" float_: "); out.append(" float_: ");
sprintf(buffer, "%g", this->float_); sprintf(buffer, "%g", this->float_);
out.append(buffer); out.append(buffer);
@ -3151,6 +3180,10 @@ void ListEntitiesClimateResponse::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
out.append(" legacy_supports_away: ");
out.append(YESNO(this->legacy_supports_away));
out.append("\n");
out.append(" supports_action: "); out.append(" supports_action: ");
out.append(YESNO(this->supports_action)); out.append(YESNO(this->supports_action));
out.append("\n"); out.append("\n");
@ -3309,6 +3342,10 @@ void ClimateStateResponse::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
out.append(" legacy_away: ");
out.append(YESNO(this->legacy_away));
out.append("\n");
out.append(" action: "); out.append(" action: ");
out.append(proto_enum_to_string<enums::ClimateAction>(this->action)); out.append(proto_enum_to_string<enums::ClimateAction>(this->action));
out.append("\n"); out.append("\n");
@ -3508,6 +3545,10 @@ void ClimateCommandRequest::dump_to(std::string &out) const {
out.append(YESNO(this->has_legacy_away)); out.append(YESNO(this->has_legacy_away));
out.append("\n"); out.append("\n");
out.append(" legacy_away: ");
out.append(YESNO(this->legacy_away));
out.append("\n");
out.append(" has_fan_mode: "); out.append(" has_fan_mode: ");
out.append(YESNO(this->has_fan_mode)); out.append(YESNO(this->has_fan_mode));
out.append("\n"); out.append("\n");

View file

@ -183,8 +183,6 @@ class TypeInfo:
@property @property
def dump_content(self): def dump_content(self):
if self.name.startswith("legacy_"):
return None
o = f'out.append(" {self.name}: ");\n' o = f'out.append(" {self.name}: ");\n'
o += self.dump(f"this->{self.field_name}") + "\n" o += self.dump(f"this->{self.field_name}") + "\n"
o += f'out.append("\\n");\n' o += f'out.append("\\n");\n'