Remove deprecated protobuf fields to reduce flash usage

This commit is contained in:
J. Nick Koston 2025-07-18 08:13:33 -10:00
parent a11c39bdc9
commit 0a45014330
No known key found for this signature in database
5 changed files with 60 additions and 185 deletions

View File

@ -230,14 +230,16 @@ message DeviceInfoResponse {
uint32 webserver_port = 10 [(field_ifdef) = "USE_WEBSERVER"]; uint32 webserver_port = 10 [(field_ifdef) = "USE_WEBSERVER"];
uint32 legacy_bluetooth_proxy_version = 11 [(field_ifdef) = "USE_BLUETOOTH_PROXY"]; // Deprecated in API version 1.9
uint32 legacy_bluetooth_proxy_version = 11 [deprecated=true, (field_ifdef) = "USE_BLUETOOTH_PROXY"];
uint32 bluetooth_proxy_feature_flags = 15 [(field_ifdef) = "USE_BLUETOOTH_PROXY"]; uint32 bluetooth_proxy_feature_flags = 15 [(field_ifdef) = "USE_BLUETOOTH_PROXY"];
string manufacturer = 12; string manufacturer = 12;
string friendly_name = 13; string friendly_name = 13;
uint32 legacy_voice_assistant_version = 14 [(field_ifdef) = "USE_VOICE_ASSISTANT"]; // Deprecated in API version 1.10
uint32 legacy_voice_assistant_version = 14 [deprecated=true, (field_ifdef) = "USE_VOICE_ASSISTANT"];
uint32 voice_assistant_feature_flags = 17 [(field_ifdef) = "USE_VOICE_ASSISTANT"]; uint32 voice_assistant_feature_flags = 17 [(field_ifdef) = "USE_VOICE_ASSISTANT"];
string suggested_area = 16 [(field_ifdef) = "USE_AREAS"]; string suggested_area = 16 [(field_ifdef) = "USE_AREAS"];
@ -337,6 +339,7 @@ message ListEntitiesCoverResponse {
uint32 device_id = 13 [(field_ifdef) = "USE_DEVICES"]; uint32 device_id = 13 [(field_ifdef) = "USE_DEVICES"];
} }
// Deprecated in API version 1.1
enum LegacyCoverState { enum LegacyCoverState {
LEGACY_COVER_STATE_OPEN = 0; LEGACY_COVER_STATE_OPEN = 0;
LEGACY_COVER_STATE_CLOSED = 1; LEGACY_COVER_STATE_CLOSED = 1;
@ -356,7 +359,8 @@ message CoverStateResponse {
fixed32 key = 1; fixed32 key = 1;
// legacy: state has been removed in 1.13 // legacy: state has been removed in 1.13
// clients/servers must still send/accept it until the next protocol change // clients/servers must still send/accept it until the next protocol change
LegacyCoverState legacy_state = 2; // Deprecated in API version 1.1
LegacyCoverState legacy_state = 2 [deprecated=true];
float position = 3; float position = 3;
float tilt = 4; float tilt = 4;
@ -364,6 +368,7 @@ message CoverStateResponse {
uint32 device_id = 6 [(field_ifdef) = "USE_DEVICES"]; uint32 device_id = 6 [(field_ifdef) = "USE_DEVICES"];
} }
// Deprecated in API version 1.1
enum LegacyCoverCommand { enum LegacyCoverCommand {
LEGACY_COVER_COMMAND_OPEN = 0; LEGACY_COVER_COMMAND_OPEN = 0;
LEGACY_COVER_COMMAND_CLOSE = 1; LEGACY_COVER_COMMAND_CLOSE = 1;
@ -380,8 +385,10 @@ message CoverCommandRequest {
// legacy: command has been removed in 1.13 // legacy: command has been removed in 1.13
// clients/servers must still send/accept it until the next protocol change // clients/servers must still send/accept it until the next protocol change
bool has_legacy_command = 2; // Deprecated in API version 1.1
LegacyCoverCommand legacy_command = 3; bool has_legacy_command = 2 [deprecated=true];
// Deprecated in API version 1.1
LegacyCoverCommand legacy_command = 3 [deprecated=true];
bool has_position = 4; bool has_position = 4;
float position = 5; float position = 5;
@ -432,6 +439,7 @@ message FanStateResponse {
fixed32 key = 1; fixed32 key = 1;
bool state = 2; bool state = 2;
bool oscillating = 3; bool oscillating = 3;
// Deprecated in API version 1.6
FanSpeed speed = 4 [deprecated=true]; FanSpeed speed = 4 [deprecated=true];
FanDirection direction = 5; FanDirection direction = 5;
int32 speed_level = 6; int32 speed_level = 6;
@ -448,7 +456,9 @@ message FanCommandRequest {
fixed32 key = 1; fixed32 key = 1;
bool has_state = 2; bool has_state = 2;
bool state = 3; bool state = 3;
// Deprecated in API version 1.6
bool has_speed = 4 [deprecated=true]; bool has_speed = 4 [deprecated=true];
// Deprecated in API version 1.6
FanSpeed speed = 5 [deprecated=true]; FanSpeed speed = 5 [deprecated=true];
bool has_oscillating = 6; bool has_oscillating = 6;
bool oscillating = 7; bool oscillating = 7;
@ -488,9 +498,13 @@ message ListEntitiesLightResponse {
repeated ColorMode supported_color_modes = 12; repeated ColorMode supported_color_modes = 12;
// next four supports_* are for legacy clients, newer clients should use color modes // next four supports_* are for legacy clients, newer clients should use color modes
// Deprecated in API version 1.6
bool legacy_supports_brightness = 5 [deprecated=true]; bool legacy_supports_brightness = 5 [deprecated=true];
// Deprecated in API version 1.6
bool legacy_supports_rgb = 6 [deprecated=true]; bool legacy_supports_rgb = 6 [deprecated=true];
// Deprecated in API version 1.6
bool legacy_supports_white_value = 7 [deprecated=true]; bool legacy_supports_white_value = 7 [deprecated=true];
// Deprecated in API version 1.6
bool legacy_supports_color_temperature = 8 [deprecated=true]; bool legacy_supports_color_temperature = 8 [deprecated=true];
float min_mireds = 9; float min_mireds = 9;
float max_mireds = 10; float max_mireds = 10;
@ -567,6 +581,7 @@ enum SensorStateClass {
STATE_CLASS_TOTAL = 3; STATE_CLASS_TOTAL = 3;
} }
// Deprecated in API version 1.5
enum SensorLastResetType { enum SensorLastResetType {
LAST_RESET_NONE = 0; LAST_RESET_NONE = 0;
LAST_RESET_NEVER = 1; LAST_RESET_NEVER = 1;
@ -591,7 +606,8 @@ message ListEntitiesSensorResponse {
string device_class = 9; string device_class = 9;
SensorStateClass state_class = 10; SensorStateClass state_class = 10;
// Last reset type removed in 2021.9.0 // Last reset type removed in 2021.9.0
SensorLastResetType legacy_last_reset_type = 11; // Deprecated in API version 1.5
SensorLastResetType legacy_last_reset_type = 11 [deprecated=true];
bool disabled_by_default = 12; bool disabled_by_default = 12;
EntityCategory entity_category = 13; EntityCategory entity_category = 13;
uint32 device_id = 14 [(field_ifdef) = "USE_DEVICES"]; uint32 device_id = 14 [(field_ifdef) = "USE_DEVICES"];
@ -947,7 +963,8 @@ message ListEntitiesClimateResponse {
float visual_target_temperature_step = 10; float visual_target_temperature_step = 10;
// for older peer versions - in new system this // for older peer versions - in new system this
// is if CLIMATE_PRESET_AWAY exists is supported_presets // is if CLIMATE_PRESET_AWAY exists is supported_presets
bool legacy_supports_away = 11; // Deprecated in API version 1.5
bool legacy_supports_away = 11 [deprecated=true];
bool supports_action = 12; bool supports_action = 12;
repeated ClimateFanMode supported_fan_modes = 13; repeated ClimateFanMode supported_fan_modes = 13;
repeated ClimateSwingMode supported_swing_modes = 14; repeated ClimateSwingMode supported_swing_modes = 14;
@ -978,7 +995,8 @@ message ClimateStateResponse {
float target_temperature_low = 5; float target_temperature_low = 5;
float target_temperature_high = 6; float target_temperature_high = 6;
// For older peers, equal to preset == CLIMATE_PRESET_AWAY // For older peers, equal to preset == CLIMATE_PRESET_AWAY
bool unused_legacy_away = 7; // Deprecated in API version 1.5
bool unused_legacy_away = 7 [deprecated=true];
ClimateAction action = 8; ClimateAction action = 8;
ClimateFanMode fan_mode = 9; ClimateFanMode fan_mode = 9;
ClimateSwingMode swing_mode = 10; ClimateSwingMode swing_mode = 10;
@ -1006,8 +1024,10 @@ message ClimateCommandRequest {
bool has_target_temperature_high = 8; bool has_target_temperature_high = 8;
float target_temperature_high = 9; float target_temperature_high = 9;
// legacy, for older peers, newer ones should use CLIMATE_PRESET_AWAY in preset // legacy, for older peers, newer ones should use CLIMATE_PRESET_AWAY in preset
bool unused_has_legacy_away = 10; // Deprecated in API version 1.5
bool unused_legacy_away = 11; bool unused_has_legacy_away = 10 [deprecated=true];
// Deprecated in API version 1.5
bool unused_legacy_away = 11 [deprecated=true];
bool has_fan_mode = 12; bool has_fan_mode = 12;
ClimateFanMode fan_mode = 13; ClimateFanMode fan_mode = 13;
bool has_swing_mode = 14; bool has_swing_mode = 14;
@ -1356,6 +1376,7 @@ message SubscribeBluetoothLEAdvertisementsRequest {
message BluetoothServiceData { message BluetoothServiceData {
string uuid = 1; string uuid = 1;
// Deprecated in API version 1.7
repeated uint32 legacy_data = 2 [deprecated=true]; // Removed in api version 1.7 repeated uint32 legacy_data = 2 [deprecated=true]; // Removed in api version 1.7
bytes data = 3; // Added in api version 1.7 bytes data = 3; // Added in api version 1.7
} }

View File

@ -94,17 +94,11 @@ void DeviceInfoResponse::encode(ProtoWriteBuffer buffer) const {
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
buffer.encode_uint32(10, this->webserver_port); buffer.encode_uint32(10, this->webserver_port);
#endif #endif
#ifdef USE_BLUETOOTH_PROXY
buffer.encode_uint32(11, this->legacy_bluetooth_proxy_version);
#endif
#ifdef USE_BLUETOOTH_PROXY #ifdef USE_BLUETOOTH_PROXY
buffer.encode_uint32(15, this->bluetooth_proxy_feature_flags); buffer.encode_uint32(15, this->bluetooth_proxy_feature_flags);
#endif #endif
buffer.encode_string(12, this->manufacturer); buffer.encode_string(12, this->manufacturer);
buffer.encode_string(13, this->friendly_name); buffer.encode_string(13, this->friendly_name);
#ifdef USE_VOICE_ASSISTANT
buffer.encode_uint32(14, this->legacy_voice_assistant_version);
#endif
#ifdef USE_VOICE_ASSISTANT #ifdef USE_VOICE_ASSISTANT
buffer.encode_uint32(17, this->voice_assistant_feature_flags); buffer.encode_uint32(17, this->voice_assistant_feature_flags);
#endif #endif
@ -150,17 +144,11 @@ void DeviceInfoResponse::calculate_size(uint32_t &total_size) const {
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
ProtoSize::add_uint32_field(total_size, 1, this->webserver_port); ProtoSize::add_uint32_field(total_size, 1, this->webserver_port);
#endif #endif
#ifdef USE_BLUETOOTH_PROXY
ProtoSize::add_uint32_field(total_size, 1, this->legacy_bluetooth_proxy_version);
#endif
#ifdef USE_BLUETOOTH_PROXY #ifdef USE_BLUETOOTH_PROXY
ProtoSize::add_uint32_field(total_size, 1, this->bluetooth_proxy_feature_flags); ProtoSize::add_uint32_field(total_size, 1, this->bluetooth_proxy_feature_flags);
#endif #endif
ProtoSize::add_string_field(total_size, 1, this->manufacturer); ProtoSize::add_string_field(total_size, 1, this->manufacturer);
ProtoSize::add_string_field(total_size, 1, this->friendly_name); ProtoSize::add_string_field(total_size, 1, this->friendly_name);
#ifdef USE_VOICE_ASSISTANT
ProtoSize::add_uint32_field(total_size, 1, this->legacy_voice_assistant_version);
#endif
#ifdef USE_VOICE_ASSISTANT #ifdef USE_VOICE_ASSISTANT
ProtoSize::add_uint32_field(total_size, 2, this->voice_assistant_feature_flags); ProtoSize::add_uint32_field(total_size, 2, this->voice_assistant_feature_flags);
#endif #endif
@ -270,7 +258,6 @@ void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const {
} }
void CoverStateResponse::encode(ProtoWriteBuffer buffer) const { void CoverStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_uint32(2, static_cast<uint32_t>(this->legacy_state));
buffer.encode_float(3, this->position); buffer.encode_float(3, this->position);
buffer.encode_float(4, this->tilt); buffer.encode_float(4, this->tilt);
buffer.encode_uint32(5, static_cast<uint32_t>(this->current_operation)); buffer.encode_uint32(5, static_cast<uint32_t>(this->current_operation));
@ -280,7 +267,6 @@ void CoverStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
void CoverStateResponse::calculate_size(uint32_t &total_size) const { void CoverStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_state));
ProtoSize::add_float_field(total_size, 1, this->position); ProtoSize::add_float_field(total_size, 1, this->position);
ProtoSize::add_float_field(total_size, 1, this->tilt); ProtoSize::add_float_field(total_size, 1, this->tilt);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->current_operation));
@ -290,12 +276,6 @@ void CoverStateResponse::calculate_size(uint32_t &total_size) const {
} }
bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) { switch (field_id) {
case 2:
this->has_legacy_command = value.as_bool();
break;
case 3:
this->legacy_command = static_cast<enums::LegacyCoverCommand>(value.as_uint32());
break;
case 4: case 4:
this->has_position = value.as_bool(); this->has_position = value.as_bool();
break; break;
@ -379,7 +359,6 @@ void FanStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key); buffer.encode_fixed32(1, this->key);
buffer.encode_bool(2, this->state); buffer.encode_bool(2, this->state);
buffer.encode_bool(3, this->oscillating); buffer.encode_bool(3, this->oscillating);
buffer.encode_uint32(4, static_cast<uint32_t>(this->speed));
buffer.encode_uint32(5, static_cast<uint32_t>(this->direction)); buffer.encode_uint32(5, static_cast<uint32_t>(this->direction));
buffer.encode_int32(6, this->speed_level); buffer.encode_int32(6, this->speed_level);
buffer.encode_string(7, this->preset_mode); buffer.encode_string(7, this->preset_mode);
@ -391,7 +370,6 @@ void FanStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_fixed32_field(total_size, 1, this->key); ProtoSize::add_fixed32_field(total_size, 1, this->key);
ProtoSize::add_bool_field(total_size, 1, this->state); ProtoSize::add_bool_field(total_size, 1, this->state);
ProtoSize::add_bool_field(total_size, 1, this->oscillating); ProtoSize::add_bool_field(total_size, 1, this->oscillating);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->speed));
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->direction)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->direction));
ProtoSize::add_int32_field(total_size, 1, this->speed_level); ProtoSize::add_int32_field(total_size, 1, this->speed_level);
ProtoSize::add_string_field(total_size, 1, this->preset_mode); ProtoSize::add_string_field(total_size, 1, this->preset_mode);
@ -407,12 +385,6 @@ bool FanCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
case 3: case 3:
this->state = value.as_bool(); this->state = value.as_bool();
break; break;
case 4:
this->has_speed = value.as_bool();
break;
case 5:
this->speed = static_cast<enums::FanSpeed>(value.as_uint32());
break;
case 6: case 6:
this->has_oscillating = value.as_bool(); this->has_oscillating = value.as_bool();
break; break;
@ -473,10 +445,6 @@ void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const {
for (auto &it : this->supported_color_modes) { for (auto &it : this->supported_color_modes) {
buffer.encode_uint32(12, static_cast<uint32_t>(it), true); buffer.encode_uint32(12, static_cast<uint32_t>(it), true);
} }
buffer.encode_bool(5, this->legacy_supports_brightness);
buffer.encode_bool(6, this->legacy_supports_rgb);
buffer.encode_bool(7, this->legacy_supports_white_value);
buffer.encode_bool(8, this->legacy_supports_color_temperature);
buffer.encode_float(9, this->min_mireds); buffer.encode_float(9, this->min_mireds);
buffer.encode_float(10, this->max_mireds); buffer.encode_float(10, this->max_mireds);
for (auto &it : this->effects) { for (auto &it : this->effects) {
@ -500,10 +468,6 @@ void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_enum_field_repeated(total_size, 1, static_cast<uint32_t>(it)); ProtoSize::add_enum_field_repeated(total_size, 1, static_cast<uint32_t>(it));
} }
} }
ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_brightness);
ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_rgb);
ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_white_value);
ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_color_temperature);
ProtoSize::add_float_field(total_size, 1, this->min_mireds); ProtoSize::add_float_field(total_size, 1, this->min_mireds);
ProtoSize::add_float_field(total_size, 1, this->max_mireds); ProtoSize::add_float_field(total_size, 1, this->max_mireds);
if (!this->effects.empty()) { if (!this->effects.empty()) {
@ -677,7 +641,6 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_bool(8, this->force_update); buffer.encode_bool(8, this->force_update);
buffer.encode_string(9, this->device_class); buffer.encode_string(9, this->device_class);
buffer.encode_uint32(10, static_cast<uint32_t>(this->state_class)); buffer.encode_uint32(10, static_cast<uint32_t>(this->state_class));
buffer.encode_uint32(11, static_cast<uint32_t>(this->legacy_last_reset_type));
buffer.encode_bool(12, this->disabled_by_default); buffer.encode_bool(12, this->disabled_by_default);
buffer.encode_uint32(13, static_cast<uint32_t>(this->entity_category)); buffer.encode_uint32(13, static_cast<uint32_t>(this->entity_category));
#ifdef USE_DEVICES #ifdef USE_DEVICES
@ -696,7 +659,6 @@ void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_bool_field(total_size, 1, this->force_update); ProtoSize::add_bool_field(total_size, 1, this->force_update);
ProtoSize::add_string_field(total_size, 1, this->device_class); ProtoSize::add_string_field(total_size, 1, this->device_class);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state_class)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->state_class));
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->legacy_last_reset_type));
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default); ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->entity_category));
#ifdef USE_DEVICES #ifdef USE_DEVICES
@ -1105,7 +1067,6 @@ void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_float(8, this->visual_min_temperature); buffer.encode_float(8, this->visual_min_temperature);
buffer.encode_float(9, this->visual_max_temperature); buffer.encode_float(9, this->visual_max_temperature);
buffer.encode_float(10, this->visual_target_temperature_step); buffer.encode_float(10, this->visual_target_temperature_step);
buffer.encode_bool(11, this->legacy_supports_away);
buffer.encode_bool(12, this->supports_action); buffer.encode_bool(12, this->supports_action);
for (auto &it : this->supported_fan_modes) { for (auto &it : this->supported_fan_modes) {
buffer.encode_uint32(13, static_cast<uint32_t>(it), true); buffer.encode_uint32(13, static_cast<uint32_t>(it), true);
@ -1150,7 +1111,6 @@ void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_float_field(total_size, 1, this->visual_min_temperature); ProtoSize::add_float_field(total_size, 1, this->visual_min_temperature);
ProtoSize::add_float_field(total_size, 1, this->visual_max_temperature); ProtoSize::add_float_field(total_size, 1, this->visual_max_temperature);
ProtoSize::add_float_field(total_size, 1, this->visual_target_temperature_step); ProtoSize::add_float_field(total_size, 1, this->visual_target_temperature_step);
ProtoSize::add_bool_field(total_size, 1, this->legacy_supports_away);
ProtoSize::add_bool_field(total_size, 1, this->supports_action); ProtoSize::add_bool_field(total_size, 1, this->supports_action);
if (!this->supported_fan_modes.empty()) { if (!this->supported_fan_modes.empty()) {
for (const auto &it : this->supported_fan_modes) { for (const auto &it : this->supported_fan_modes) {
@ -1198,7 +1158,6 @@ void ClimateStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_float(4, this->target_temperature); buffer.encode_float(4, this->target_temperature);
buffer.encode_float(5, this->target_temperature_low); buffer.encode_float(5, this->target_temperature_low);
buffer.encode_float(6, this->target_temperature_high); buffer.encode_float(6, this->target_temperature_high);
buffer.encode_bool(7, this->unused_legacy_away);
buffer.encode_uint32(8, static_cast<uint32_t>(this->action)); buffer.encode_uint32(8, static_cast<uint32_t>(this->action));
buffer.encode_uint32(9, static_cast<uint32_t>(this->fan_mode)); buffer.encode_uint32(9, static_cast<uint32_t>(this->fan_mode));
buffer.encode_uint32(10, static_cast<uint32_t>(this->swing_mode)); buffer.encode_uint32(10, static_cast<uint32_t>(this->swing_mode));
@ -1218,7 +1177,6 @@ void ClimateStateResponse::calculate_size(uint32_t &total_size) const {
ProtoSize::add_float_field(total_size, 1, this->target_temperature); ProtoSize::add_float_field(total_size, 1, this->target_temperature);
ProtoSize::add_float_field(total_size, 1, this->target_temperature_low); ProtoSize::add_float_field(total_size, 1, this->target_temperature_low);
ProtoSize::add_float_field(total_size, 1, this->target_temperature_high); ProtoSize::add_float_field(total_size, 1, this->target_temperature_high);
ProtoSize::add_bool_field(total_size, 1, this->unused_legacy_away);
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->action)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->action));
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->fan_mode)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->fan_mode));
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->swing_mode)); ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->swing_mode));
@ -1248,12 +1206,6 @@ bool ClimateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value)
case 8: case 8:
this->has_target_temperature_high = value.as_bool(); this->has_target_temperature_high = value.as_bool();
break; break;
case 10:
this->unused_has_legacy_away = value.as_bool();
break;
case 11:
this->unused_legacy_away = value.as_bool();
break;
case 12: case 12:
this->has_fan_mode = value.as_bool(); this->has_fan_mode = value.as_bool();
break; break;
@ -1871,18 +1823,10 @@ bool SubscribeBluetoothLEAdvertisementsRequest::decode_varint(uint32_t field_id,
} }
void BluetoothServiceData::encode(ProtoWriteBuffer buffer) const { void BluetoothServiceData::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(1, this->uuid); buffer.encode_string(1, this->uuid);
for (auto &it : this->legacy_data) {
buffer.encode_uint32(2, it, true);
}
buffer.encode_bytes(3, reinterpret_cast<const uint8_t *>(this->data.data()), this->data.size()); buffer.encode_bytes(3, reinterpret_cast<const uint8_t *>(this->data.data()), this->data.size());
} }
void BluetoothServiceData::calculate_size(uint32_t &total_size) const { void BluetoothServiceData::calculate_size(uint32_t &total_size) const {
ProtoSize::add_string_field(total_size, 1, this->uuid); ProtoSize::add_string_field(total_size, 1, this->uuid);
if (!this->legacy_data.empty()) {
for (const auto &it : this->legacy_data) {
ProtoSize::add_uint32_field_repeated(total_size, 1, it);
}
}
ProtoSize::add_string_field(total_size, 1, this->data); ProtoSize::add_string_field(total_size, 1, this->data);
} }
void BluetoothLEAdvertisementResponse::encode(ProtoWriteBuffer buffer) const { void BluetoothLEAdvertisementResponse::encode(ProtoWriteBuffer buffer) const {

View File

@ -477,7 +477,7 @@ class DeviceInfo : public ProtoMessage {
class DeviceInfoResponse : public ProtoMessage { class DeviceInfoResponse : public ProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 10; static constexpr uint8_t MESSAGE_TYPE = 10;
static constexpr uint8_t ESTIMATED_SIZE = 219; static constexpr uint8_t ESTIMATED_SIZE = 211;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "device_info_response"; } const char *message_name() const override { return "device_info_response"; }
#endif #endif
@ -499,17 +499,11 @@ class DeviceInfoResponse : public ProtoMessage {
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
uint32_t webserver_port{0}; uint32_t webserver_port{0};
#endif #endif
#ifdef USE_BLUETOOTH_PROXY
uint32_t legacy_bluetooth_proxy_version{0};
#endif
#ifdef USE_BLUETOOTH_PROXY #ifdef USE_BLUETOOTH_PROXY
uint32_t bluetooth_proxy_feature_flags{0}; uint32_t bluetooth_proxy_feature_flags{0};
#endif #endif
std::string manufacturer{}; std::string manufacturer{};
std::string friendly_name{}; std::string friendly_name{};
#ifdef USE_VOICE_ASSISTANT
uint32_t legacy_voice_assistant_version{0};
#endif
#ifdef USE_VOICE_ASSISTANT #ifdef USE_VOICE_ASSISTANT
uint32_t voice_assistant_feature_flags{0}; uint32_t voice_assistant_feature_flags{0};
#endif #endif
@ -638,11 +632,10 @@ class ListEntitiesCoverResponse : public InfoResponseProtoMessage {
class CoverStateResponse : public StateResponseProtoMessage { class CoverStateResponse : public StateResponseProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 22; static constexpr uint8_t MESSAGE_TYPE = 22;
static constexpr uint8_t ESTIMATED_SIZE = 23; static constexpr uint8_t ESTIMATED_SIZE = 21;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "cover_state_response"; } const char *message_name() const override { return "cover_state_response"; }
#endif #endif
enums::LegacyCoverState legacy_state{};
float position{0.0f}; float position{0.0f};
float tilt{0.0f}; float tilt{0.0f};
enums::CoverOperation current_operation{}; enums::CoverOperation current_operation{};
@ -657,12 +650,10 @@ class CoverStateResponse : public StateResponseProtoMessage {
class CoverCommandRequest : public CommandProtoMessage { class CoverCommandRequest : public CommandProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 30; static constexpr uint8_t MESSAGE_TYPE = 30;
static constexpr uint8_t ESTIMATED_SIZE = 29; static constexpr uint8_t ESTIMATED_SIZE = 25;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "cover_command_request"; } const char *message_name() const override { return "cover_command_request"; }
#endif #endif
bool has_legacy_command{false};
enums::LegacyCoverCommand legacy_command{};
bool has_position{false}; bool has_position{false};
float position{0.0f}; float position{0.0f};
bool has_tilt{false}; bool has_tilt{false};
@ -701,13 +692,12 @@ class ListEntitiesFanResponse : public InfoResponseProtoMessage {
class FanStateResponse : public StateResponseProtoMessage { class FanStateResponse : public StateResponseProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 23; static constexpr uint8_t MESSAGE_TYPE = 23;
static constexpr uint8_t ESTIMATED_SIZE = 30; static constexpr uint8_t ESTIMATED_SIZE = 28;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "fan_state_response"; } const char *message_name() const override { return "fan_state_response"; }
#endif #endif
bool state{false}; bool state{false};
bool oscillating{false}; bool oscillating{false};
enums::FanSpeed speed{};
enums::FanDirection direction{}; enums::FanDirection direction{};
int32_t speed_level{0}; int32_t speed_level{0};
std::string preset_mode{}; std::string preset_mode{};
@ -722,14 +712,12 @@ class FanStateResponse : public StateResponseProtoMessage {
class FanCommandRequest : public CommandProtoMessage { class FanCommandRequest : public CommandProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 31; static constexpr uint8_t MESSAGE_TYPE = 31;
static constexpr uint8_t ESTIMATED_SIZE = 42; static constexpr uint8_t ESTIMATED_SIZE = 38;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "fan_command_request"; } const char *message_name() const override { return "fan_command_request"; }
#endif #endif
bool has_state{false}; bool has_state{false};
bool state{false}; bool state{false};
bool has_speed{false};
enums::FanSpeed speed{};
bool has_oscillating{false}; bool has_oscillating{false};
bool oscillating{false}; bool oscillating{false};
bool has_direction{false}; bool has_direction{false};
@ -752,15 +740,11 @@ class FanCommandRequest : public CommandProtoMessage {
class ListEntitiesLightResponse : public InfoResponseProtoMessage { class ListEntitiesLightResponse : public InfoResponseProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 15; static constexpr uint8_t MESSAGE_TYPE = 15;
static constexpr uint8_t ESTIMATED_SIZE = 81; static constexpr uint8_t ESTIMATED_SIZE = 73;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "list_entities_light_response"; } const char *message_name() const override { return "list_entities_light_response"; }
#endif #endif
std::vector<enums::ColorMode> supported_color_modes{}; std::vector<enums::ColorMode> supported_color_modes{};
bool legacy_supports_brightness{false};
bool legacy_supports_rgb{false};
bool legacy_supports_white_value{false};
bool legacy_supports_color_temperature{false};
float min_mireds{0.0f}; float min_mireds{0.0f};
float max_mireds{0.0f}; float max_mireds{0.0f};
std::vector<std::string> effects{}; std::vector<std::string> effects{};
@ -846,7 +830,7 @@ class LightCommandRequest : public CommandProtoMessage {
class ListEntitiesSensorResponse : public InfoResponseProtoMessage { class ListEntitiesSensorResponse : public InfoResponseProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 16; static constexpr uint8_t MESSAGE_TYPE = 16;
static constexpr uint8_t ESTIMATED_SIZE = 68; static constexpr uint8_t ESTIMATED_SIZE = 66;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "list_entities_sensor_response"; } const char *message_name() const override { return "list_entities_sensor_response"; }
#endif #endif
@ -855,7 +839,6 @@ class ListEntitiesSensorResponse : public InfoResponseProtoMessage {
bool force_update{false}; bool force_update{false};
std::string device_class{}; std::string device_class{};
enums::SensorStateClass state_class{}; enums::SensorStateClass state_class{};
enums::SensorLastResetType legacy_last_reset_type{};
void encode(ProtoWriteBuffer buffer) const override; void encode(ProtoWriteBuffer buffer) const override;
void calculate_size(uint32_t &total_size) const override; void calculate_size(uint32_t &total_size) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
@ -1281,7 +1264,7 @@ class CameraImageRequest : public ProtoDecodableMessage {
class ListEntitiesClimateResponse : public InfoResponseProtoMessage { class ListEntitiesClimateResponse : public InfoResponseProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 46; static constexpr uint8_t MESSAGE_TYPE = 46;
static constexpr uint8_t ESTIMATED_SIZE = 147; static constexpr uint8_t ESTIMATED_SIZE = 145;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "list_entities_climate_response"; } const char *message_name() const override { return "list_entities_climate_response"; }
#endif #endif
@ -1291,7 +1274,6 @@ class ListEntitiesClimateResponse : public InfoResponseProtoMessage {
float visual_min_temperature{0.0f}; float visual_min_temperature{0.0f};
float visual_max_temperature{0.0f}; float visual_max_temperature{0.0f};
float visual_target_temperature_step{0.0f}; float visual_target_temperature_step{0.0f};
bool legacy_supports_away{false};
bool supports_action{false}; bool supports_action{false};
std::vector<enums::ClimateFanMode> supported_fan_modes{}; std::vector<enums::ClimateFanMode> supported_fan_modes{};
std::vector<enums::ClimateSwingMode> supported_swing_modes{}; std::vector<enums::ClimateSwingMode> supported_swing_modes{};
@ -1314,7 +1296,7 @@ class ListEntitiesClimateResponse : public InfoResponseProtoMessage {
class ClimateStateResponse : public StateResponseProtoMessage { class ClimateStateResponse : public StateResponseProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 47; static constexpr uint8_t MESSAGE_TYPE = 47;
static constexpr uint8_t ESTIMATED_SIZE = 70; static constexpr uint8_t ESTIMATED_SIZE = 68;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "climate_state_response"; } const char *message_name() const override { return "climate_state_response"; }
#endif #endif
@ -1323,7 +1305,6 @@ class ClimateStateResponse : public StateResponseProtoMessage {
float target_temperature{0.0f}; float target_temperature{0.0f};
float target_temperature_low{0.0f}; float target_temperature_low{0.0f};
float target_temperature_high{0.0f}; float target_temperature_high{0.0f};
bool unused_legacy_away{false};
enums::ClimateAction action{}; enums::ClimateAction action{};
enums::ClimateFanMode fan_mode{}; enums::ClimateFanMode fan_mode{};
enums::ClimateSwingMode swing_mode{}; enums::ClimateSwingMode swing_mode{};
@ -1343,7 +1324,7 @@ class ClimateStateResponse : public StateResponseProtoMessage {
class ClimateCommandRequest : public CommandProtoMessage { class ClimateCommandRequest : public CommandProtoMessage {
public: public:
static constexpr uint8_t MESSAGE_TYPE = 48; static constexpr uint8_t MESSAGE_TYPE = 48;
static constexpr uint8_t ESTIMATED_SIZE = 88; static constexpr uint8_t ESTIMATED_SIZE = 84;
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
const char *message_name() const override { return "climate_command_request"; } const char *message_name() const override { return "climate_command_request"; }
#endif #endif
@ -1355,8 +1336,6 @@ class ClimateCommandRequest : public CommandProtoMessage {
float target_temperature_low{0.0f}; float target_temperature_low{0.0f};
bool has_target_temperature_high{false}; bool has_target_temperature_high{false};
float target_temperature_high{0.0f}; float target_temperature_high{0.0f};
bool unused_has_legacy_away{false};
bool unused_legacy_away{false};
bool has_fan_mode{false}; bool has_fan_mode{false};
enums::ClimateFanMode fan_mode{}; enums::ClimateFanMode fan_mode{};
bool has_swing_mode{false}; bool has_swing_mode{false};
@ -1731,7 +1710,6 @@ class SubscribeBluetoothLEAdvertisementsRequest : public ProtoDecodableMessage {
class BluetoothServiceData : public ProtoMessage { class BluetoothServiceData : public ProtoMessage {
public: public:
std::string uuid{}; std::string uuid{};
std::vector<uint32_t> legacy_data{};
std::string data{}; std::string data{};
void encode(ProtoWriteBuffer buffer) const override; void encode(ProtoWriteBuffer buffer) const override;
void calculate_size(uint32_t &total_size) const override; void calculate_size(uint32_t &total_size) const override;

View File

@ -737,13 +737,6 @@ void DeviceInfoResponse::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
#endif
#ifdef USE_BLUETOOTH_PROXY
out.append(" legacy_bluetooth_proxy_version: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->legacy_bluetooth_proxy_version);
out.append(buffer);
out.append("\n");
#endif #endif
#ifdef USE_BLUETOOTH_PROXY #ifdef USE_BLUETOOTH_PROXY
out.append(" bluetooth_proxy_feature_flags: "); out.append(" bluetooth_proxy_feature_flags: ");
@ -760,13 +753,6 @@ void DeviceInfoResponse::dump_to(std::string &out) const {
out.append("'").append(this->friendly_name).append("'"); out.append("'").append(this->friendly_name).append("'");
out.append("\n"); out.append("\n");
#ifdef USE_VOICE_ASSISTANT
out.append(" legacy_voice_assistant_version: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->legacy_voice_assistant_version);
out.append(buffer);
out.append("\n");
#endif
#ifdef USE_VOICE_ASSISTANT #ifdef USE_VOICE_ASSISTANT
out.append(" voice_assistant_feature_flags: "); out.append(" voice_assistant_feature_flags: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, this->voice_assistant_feature_flags); snprintf(buffer, sizeof(buffer), "%" PRIu32, this->voice_assistant_feature_flags);
@ -961,10 +947,6 @@ 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: ");
snprintf(buffer, sizeof(buffer), "%g", this->position); snprintf(buffer, sizeof(buffer), "%g", this->position);
out.append(buffer); out.append(buffer);
@ -996,14 +978,6 @@ void CoverCommandRequest::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
out.append(" has_legacy_command: ");
out.append(YESNO(this->has_legacy_command));
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");
@ -1115,10 +1089,6 @@ void FanStateResponse::dump_to(std::string &out) const {
out.append(YESNO(this->oscillating)); out.append(YESNO(this->oscillating));
out.append("\n"); out.append("\n");
out.append(" speed: ");
out.append(proto_enum_to_string<enums::FanSpeed>(this->speed));
out.append("\n");
out.append(" direction: "); out.append(" direction: ");
out.append(proto_enum_to_string<enums::FanDirection>(this->direction)); out.append(proto_enum_to_string<enums::FanDirection>(this->direction));
out.append("\n"); out.append("\n");
@ -1157,14 +1127,6 @@ void FanCommandRequest::dump_to(std::string &out) const {
out.append(YESNO(this->state)); out.append(YESNO(this->state));
out.append("\n"); out.append("\n");
out.append(" has_speed: ");
out.append(YESNO(this->has_speed));
out.append("\n");
out.append(" speed: ");
out.append(proto_enum_to_string<enums::FanSpeed>(this->speed));
out.append("\n");
out.append(" has_oscillating: "); out.append(" has_oscillating: ");
out.append(YESNO(this->has_oscillating)); out.append(YESNO(this->has_oscillating));
out.append("\n"); out.append("\n");
@ -1231,22 +1193,6 @@ 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: ");
snprintf(buffer, sizeof(buffer), "%g", this->min_mireds); snprintf(buffer, sizeof(buffer), "%g", this->min_mireds);
out.append(buffer); out.append(buffer);
@ -1537,10 +1483,6 @@ void ListEntitiesSensorResponse::dump_to(std::string &out) const {
out.append(proto_enum_to_string<enums::SensorStateClass>(this->state_class)); out.append(proto_enum_to_string<enums::SensorStateClass>(this->state_class));
out.append("\n"); out.append("\n");
out.append(" legacy_last_reset_type: ");
out.append(proto_enum_to_string<enums::SensorLastResetType>(this->legacy_last_reset_type));
out.append("\n");
out.append(" disabled_by_default: "); out.append(" disabled_by_default: ");
out.append(YESNO(this->disabled_by_default)); out.append(YESNO(this->disabled_by_default));
out.append("\n"); out.append("\n");
@ -2107,10 +2049,6 @@ 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");
@ -2223,10 +2161,6 @@ void ClimateStateResponse::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
out.append(" unused_legacy_away: ");
out.append(YESNO(this->unused_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");
@ -2313,14 +2247,6 @@ void ClimateCommandRequest::dump_to(std::string &out) const {
out.append(buffer); out.append(buffer);
out.append("\n"); out.append("\n");
out.append(" unused_has_legacy_away: ");
out.append(YESNO(this->unused_has_legacy_away));
out.append("\n");
out.append(" unused_legacy_away: ");
out.append(YESNO(this->unused_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");
@ -3060,13 +2986,6 @@ void BluetoothServiceData::dump_to(std::string &out) const {
out.append("'").append(this->uuid).append("'"); out.append("'").append(this->uuid).append("'");
out.append("\n"); out.append("\n");
for (const auto &it : this->legacy_data) {
out.append(" legacy_data: ");
snprintf(buffer, sizeof(buffer), "%" PRIu32, it);
out.append(buffer);
out.append("\n");
}
out.append(" data: "); out.append(" data: ");
out.append(format_hex_pretty(this->data)); out.append(format_hex_pretty(this->data));
out.append("\n"); out.append("\n");

View File

@ -1145,6 +1145,10 @@ def calculate_message_estimated_size(desc: descriptor.DescriptorProto) -> int:
total_size = 0 total_size = 0
for field in desc.field: for field in desc.field:
# Skip deprecated fields
if field.options.deprecated:
continue
ti = create_field_type_info(field) ti = create_field_type_info(field)
# Add estimated size for this field # Add estimated size for this field
@ -1213,6 +1217,10 @@ def build_message_type(
public_content.append("#endif") public_content.append("#endif")
for field in desc.field: for field in desc.field:
# Skip deprecated fields completely
if field.options.deprecated:
continue
ti = create_field_type_info(field) ti = create_field_type_info(field)
# Skip field declarations for fields that are in the base class # Skip field declarations for fields that are in the base class
@ -1459,8 +1467,10 @@ def find_common_fields(
if not messages: if not messages:
return [] return []
# Start with fields from the first message # Start with fields from the first message (excluding deprecated fields)
first_msg_fields = {field.name: field for field in messages[0].field} first_msg_fields = {
field.name: field for field in messages[0].field if not field.options.deprecated
}
common_fields = [] common_fields = []
# Check each field to see if it exists in all messages with same type # Check each field to see if it exists in all messages with same type
@ -1471,6 +1481,9 @@ def find_common_fields(
for msg in messages[1:]: for msg in messages[1:]:
found = False found = False
for other_field in msg.field: for other_field in msg.field:
# Skip deprecated fields
if other_field.options.deprecated:
continue
if ( if (
other_field.name == field_name other_field.name == field_name
and other_field.type == field.type and other_field.type == field.type