|
|
@@ -124,26 +124,54 @@ void DeviceInfoResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_string(4, this->esphome_version);
|
|
|
|
buffer.encode_string(4, this->esphome_version);
|
|
|
|
buffer.encode_string(5, this->compilation_time);
|
|
|
|
buffer.encode_string(5, this->compilation_time);
|
|
|
|
buffer.encode_string(6, this->model);
|
|
|
|
buffer.encode_string(6, this->model);
|
|
|
|
|
|
|
|
#ifdef USE_DEEP_SLEEP
|
|
|
|
buffer.encode_bool(7, this->has_deep_sleep);
|
|
|
|
buffer.encode_bool(7, this->has_deep_sleep);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ESPHOME_PROJECT_NAME
|
|
|
|
buffer.encode_string(8, this->project_name);
|
|
|
|
buffer.encode_string(8, this->project_name);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ESPHOME_PROJECT_NAME
|
|
|
|
buffer.encode_string(9, this->project_version);
|
|
|
|
buffer.encode_string(9, this->project_version);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_WEBSERVER
|
|
|
|
buffer.encode_uint32(10, this->webserver_port);
|
|
|
|
buffer.encode_uint32(10, this->webserver_port);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_BLUETOOTH_PROXY
|
|
|
|
buffer.encode_uint32(11, this->legacy_bluetooth_proxy_version);
|
|
|
|
buffer.encode_uint32(11, this->legacy_bluetooth_proxy_version);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_BLUETOOTH_PROXY
|
|
|
|
buffer.encode_uint32(15, this->bluetooth_proxy_feature_flags);
|
|
|
|
buffer.encode_uint32(15, this->bluetooth_proxy_feature_flags);
|
|
|
|
|
|
|
|
#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);
|
|
|
|
buffer.encode_uint32(14, this->legacy_voice_assistant_version);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_VOICE_ASSISTANT
|
|
|
|
buffer.encode_uint32(17, this->voice_assistant_feature_flags);
|
|
|
|
buffer.encode_uint32(17, this->voice_assistant_feature_flags);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_AREAS
|
|
|
|
buffer.encode_string(16, this->suggested_area);
|
|
|
|
buffer.encode_string(16, this->suggested_area);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_BLUETOOTH_PROXY
|
|
|
|
buffer.encode_string(18, this->bluetooth_mac_address);
|
|
|
|
buffer.encode_string(18, this->bluetooth_mac_address);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_API_NOISE
|
|
|
|
buffer.encode_bool(19, this->api_encryption_supported);
|
|
|
|
buffer.encode_bool(19, this->api_encryption_supported);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
for (auto &it : this->devices) {
|
|
|
|
for (auto &it : this->devices) {
|
|
|
|
buffer.encode_message(20, it, true);
|
|
|
|
buffer.encode_message(20, it, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_AREAS
|
|
|
|
for (auto &it : this->areas) {
|
|
|
|
for (auto &it : this->areas) {
|
|
|
|
buffer.encode_message(21, it, true);
|
|
|
|
buffer.encode_message(21, it, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_AREAS
|
|
|
|
buffer.encode_message(22, this->area);
|
|
|
|
buffer.encode_message(22, this->area);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void DeviceInfoResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void DeviceInfoResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->uses_password);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->uses_password);
|
|
|
@@ -152,22 +180,50 @@ void DeviceInfoResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->esphome_version);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->esphome_version);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->compilation_time);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->compilation_time);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->model);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->model);
|
|
|
|
|
|
|
|
#ifdef USE_DEEP_SLEEP
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->has_deep_sleep);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->has_deep_sleep);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ESPHOME_PROJECT_NAME
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->project_name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->project_name);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ESPHOME_PROJECT_NAME
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->project_version);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->project_version);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_WEBSERVER
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->webserver_port);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->webserver_port);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_BLUETOOTH_PROXY
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->legacy_bluetooth_proxy_version);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->legacy_bluetooth_proxy_version);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#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
|
|
|
|
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);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->legacy_voice_assistant_version);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
#ifdef USE_AREAS
|
|
|
|
ProtoSize::add_string_field(total_size, 2, this->suggested_area);
|
|
|
|
ProtoSize::add_string_field(total_size, 2, this->suggested_area);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_BLUETOOTH_PROXY
|
|
|
|
ProtoSize::add_string_field(total_size, 2, this->bluetooth_mac_address);
|
|
|
|
ProtoSize::add_string_field(total_size, 2, this->bluetooth_mac_address);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_API_NOISE
|
|
|
|
ProtoSize::add_bool_field(total_size, 2, this->api_encryption_supported);
|
|
|
|
ProtoSize::add_bool_field(total_size, 2, this->api_encryption_supported);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_repeated_message(total_size, 2, this->devices);
|
|
|
|
ProtoSize::add_repeated_message(total_size, 2, this->devices);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_AREAS
|
|
|
|
ProtoSize::add_repeated_message(total_size, 2, this->areas);
|
|
|
|
ProtoSize::add_repeated_message(total_size, 2, this->areas);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_AREAS
|
|
|
|
ProtoSize::add_message_object(total_size, 2, this->area);
|
|
|
|
ProtoSize::add_message_object(total_size, 2, this->area);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef USE_BINARY_SENSOR
|
|
|
|
#ifdef USE_BINARY_SENSOR
|
|
|
|
void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
@@ -178,9 +234,13 @@ void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_string(5, this->device_class);
|
|
|
|
buffer.encode_string(5, this->device_class);
|
|
|
|
buffer.encode_bool(6, this->is_status_binary_sensor);
|
|
|
|
buffer.encode_bool(6, this->is_status_binary_sensor);
|
|
|
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(8, this->icon);
|
|
|
|
buffer.encode_string(8, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_uint32(9, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(9, static_cast<uint32_t>(this->entity_category));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(10, this->device_id);
|
|
|
|
buffer.encode_uint32(10, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesBinarySensorResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesBinarySensorResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
@@ -190,9 +250,13 @@ void ListEntitiesBinarySensorResponse::calculate_size(uint32_t &total_size) cons
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->is_status_binary_sensor);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->is_status_binary_sensor);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void BinarySensorStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void BinarySensorStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -218,10 +282,14 @@ void ListEntitiesCoverResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_bool(7, this->supports_tilt);
|
|
|
|
buffer.encode_bool(7, this->supports_tilt);
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
buffer.encode_bool(9, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(9, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(10, this->icon);
|
|
|
|
buffer.encode_string(10, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_bool(12, this->supports_stop);
|
|
|
|
buffer.encode_bool(12, this->supports_stop);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(13, this->device_id);
|
|
|
|
buffer.encode_uint32(13, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
@@ -233,10 +301,14 @@ void ListEntitiesCoverResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_tilt);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_tilt);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_stop);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_stop);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void CoverStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void CoverStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -271,9 +343,11 @@ bool CoverCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
case 8:
|
|
|
|
case 8:
|
|
|
|
this->stop = value.as_bool();
|
|
|
|
this->stop = value.as_bool();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
case 9:
|
|
|
|
case 9:
|
|
|
|
this->device_id = value.as_uint32();
|
|
|
|
this->device_id = value.as_uint32();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -307,12 +381,16 @@ void ListEntitiesFanResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_bool(7, this->supports_direction);
|
|
|
|
buffer.encode_bool(7, this->supports_direction);
|
|
|
|
buffer.encode_int32(8, this->supported_speed_count);
|
|
|
|
buffer.encode_int32(8, this->supported_speed_count);
|
|
|
|
buffer.encode_bool(9, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(9, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(10, this->icon);
|
|
|
|
buffer.encode_string(10, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->entity_category));
|
|
|
|
for (auto &it : this->supported_preset_modes) {
|
|
|
|
for (auto &it : this->supported_preset_modes) {
|
|
|
|
buffer.encode_string(12, it, true);
|
|
|
|
buffer.encode_string(12, it, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(13, this->device_id);
|
|
|
|
buffer.encode_uint32(13, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
@@ -324,14 +402,18 @@ void ListEntitiesFanResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_direction);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_direction);
|
|
|
|
ProtoSize::add_int32_field(total_size, 1, this->supported_speed_count);
|
|
|
|
ProtoSize::add_int32_field(total_size, 1, this->supported_speed_count);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
if (!this->supported_preset_modes.empty()) {
|
|
|
|
if (!this->supported_preset_modes.empty()) {
|
|
|
|
for (const auto &it : this->supported_preset_modes) {
|
|
|
|
for (const auto &it : this->supported_preset_modes) {
|
|
|
|
ProtoSize::add_string_field_repeated(total_size, 1, it);
|
|
|
|
ProtoSize::add_string_field_repeated(total_size, 1, it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void FanStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void FanStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -341,7 +423,9 @@ void FanStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
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);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void FanStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void FanStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
@@ -351,7 +435,9 @@ void FanStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
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);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool FanCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
bool FanCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
switch (field_id) {
|
|
|
|
switch (field_id) {
|
|
|
@@ -436,9 +522,13 @@ void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_string(11, it, true);
|
|
|
|
buffer.encode_string(11, it, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buffer.encode_bool(13, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(13, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(14, this->icon);
|
|
|
|
buffer.encode_string(14, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_uint32(15, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(15, static_cast<uint32_t>(this->entity_category));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(16, this->device_id);
|
|
|
|
buffer.encode_uint32(16, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
@@ -462,9 +552,13 @@ void ListEntitiesLightResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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
|
|
|
|
ProtoSize::add_uint32_field(total_size, 2, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 2, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void LightStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void LightStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -610,7 +704,9 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_string(6, this->unit_of_measurement);
|
|
|
|
buffer.encode_string(6, this->unit_of_measurement);
|
|
|
|
buffer.encode_int32(7, this->accuracy_decimals);
|
|
|
|
buffer.encode_int32(7, this->accuracy_decimals);
|
|
|
|
buffer.encode_bool(8, this->force_update);
|
|
|
|
buffer.encode_bool(8, this->force_update);
|
|
|
@@ -626,7 +722,9 @@ void ListEntitiesSensorResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unit_of_measurement);
|
|
|
|
ProtoSize::add_int32_field(total_size, 1, this->accuracy_decimals);
|
|
|
|
ProtoSize::add_int32_field(total_size, 1, this->accuracy_decimals);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->force_update);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->force_update);
|
|
|
@@ -656,24 +754,32 @@ void ListEntitiesSwitchResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->assumed_state);
|
|
|
|
buffer.encode_bool(6, this->assumed_state);
|
|
|
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_string(9, this->device_class);
|
|
|
|
buffer.encode_string(9, this->device_class);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(10, this->device_id);
|
|
|
|
buffer.encode_uint32(10, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesSwitchResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->assumed_state);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->assumed_state);
|
|
|
|
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));
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void SwitchStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void SwitchStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -715,22 +821,30 @@ void ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(9, this->device_id);
|
|
|
|
buffer.encode_uint32(9, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesTextSensorResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesTextSensorResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void TextSensorStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void TextSensorStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -1027,9 +1141,13 @@ void ListEntitiesCameraResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_bool(5, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(5, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(6, this->icon);
|
|
|
|
buffer.encode_string(6, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
@@ -1037,9 +1155,13 @@ void ListEntitiesCameraResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void CameraImageResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void CameraImageResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -1099,14 +1221,18 @@ void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_string(17, it, true);
|
|
|
|
buffer.encode_string(17, it, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buffer.encode_bool(18, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(18, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(19, this->icon);
|
|
|
|
buffer.encode_string(19, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_uint32(20, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(20, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_float(21, this->visual_current_temperature_step);
|
|
|
|
buffer.encode_float(21, this->visual_current_temperature_step);
|
|
|
|
buffer.encode_bool(22, this->supports_current_humidity);
|
|
|
|
buffer.encode_bool(22, this->supports_current_humidity);
|
|
|
|
buffer.encode_bool(23, this->supports_target_humidity);
|
|
|
|
buffer.encode_bool(23, this->supports_target_humidity);
|
|
|
|
buffer.encode_float(24, this->visual_min_humidity);
|
|
|
|
buffer.encode_float(24, this->visual_min_humidity);
|
|
|
|
buffer.encode_float(25, this->visual_max_humidity);
|
|
|
|
buffer.encode_float(25, this->visual_max_humidity);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(26, this->device_id);
|
|
|
|
buffer.encode_uint32(26, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
@@ -1151,14 +1277,18 @@ void ListEntitiesClimateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ProtoSize::add_bool_field(total_size, 2, this->disabled_by_default);
|
|
|
|
ProtoSize::add_bool_field(total_size, 2, this->disabled_by_default);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 2, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 2, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(this->entity_category));
|
|
|
|
ProtoSize::add_enum_field(total_size, 2, static_cast<uint32_t>(this->entity_category));
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_current_temperature_step != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_current_temperature_step != 0.0f);
|
|
|
|
ProtoSize::add_bool_field(total_size, 2, this->supports_current_humidity);
|
|
|
|
ProtoSize::add_bool_field(total_size, 2, this->supports_current_humidity);
|
|
|
|
ProtoSize::add_bool_field(total_size, 2, this->supports_target_humidity);
|
|
|
|
ProtoSize::add_bool_field(total_size, 2, this->supports_target_humidity);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_min_humidity != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_min_humidity != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_max_humidity != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 2, this->visual_max_humidity != 0.0f);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 2, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 2, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ClimateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void ClimateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -1176,7 +1306,9 @@ void ClimateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_string(13, this->custom_preset);
|
|
|
|
buffer.encode_string(13, this->custom_preset);
|
|
|
|
buffer.encode_float(14, this->current_humidity);
|
|
|
|
buffer.encode_float(14, this->current_humidity);
|
|
|
|
buffer.encode_float(15, this->target_humidity);
|
|
|
|
buffer.encode_float(15, this->target_humidity);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(16, this->device_id);
|
|
|
|
buffer.encode_uint32(16, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ClimateStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ClimateStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
@@ -1194,7 +1326,9 @@ void ClimateStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->custom_preset);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->custom_preset);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->current_humidity != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->current_humidity != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->target_humidity != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->target_humidity != 0.0f);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 2, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 2, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool ClimateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
bool ClimateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
switch (field_id) {
|
|
|
|
switch (field_id) {
|
|
|
@@ -1296,7 +1430,9 @@ void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_float(6, this->min_value);
|
|
|
|
buffer.encode_float(6, this->min_value);
|
|
|
|
buffer.encode_float(7, this->max_value);
|
|
|
|
buffer.encode_float(7, this->max_value);
|
|
|
|
buffer.encode_float(8, this->step);
|
|
|
|
buffer.encode_float(8, this->step);
|
|
|
@@ -1312,7 +1448,9 @@ void ListEntitiesNumberResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->min_value != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->min_value != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->max_value != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->max_value != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->step != 0.0f);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->step != 0.0f);
|
|
|
@@ -1365,20 +1503,26 @@ void ListEntitiesSelectResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
for (auto &it : this->options) {
|
|
|
|
for (auto &it : this->options) {
|
|
|
|
buffer.encode_string(6, it, true);
|
|
|
|
buffer.encode_string(6, it, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(7, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(8, static_cast<uint32_t>(this->entity_category));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(9, this->device_id);
|
|
|
|
buffer.encode_uint32(9, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
if (!this->options.empty()) {
|
|
|
|
if (!this->options.empty()) {
|
|
|
|
for (const auto &it : this->options) {
|
|
|
|
for (const auto &it : this->options) {
|
|
|
|
ProtoSize::add_string_field_repeated(total_size, 1, it);
|
|
|
|
ProtoSize::add_string_field_repeated(total_size, 1, it);
|
|
|
@@ -1386,7 +1530,9 @@ void ListEntitiesSelectResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void SelectStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void SelectStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -1437,7 +1583,9 @@ void ListEntitiesSirenResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
for (auto &it : this->tones) {
|
|
|
|
for (auto &it : this->tones) {
|
|
|
|
buffer.encode_string(7, it, true);
|
|
|
|
buffer.encode_string(7, it, true);
|
|
|
@@ -1445,14 +1593,18 @@ void ListEntitiesSirenResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_bool(8, this->supports_duration);
|
|
|
|
buffer.encode_bool(8, this->supports_duration);
|
|
|
|
buffer.encode_bool(9, this->supports_volume);
|
|
|
|
buffer.encode_bool(9, this->supports_volume);
|
|
|
|
buffer.encode_uint32(10, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(10, static_cast<uint32_t>(this->entity_category));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(11, this->device_id);
|
|
|
|
buffer.encode_uint32(11, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesSirenResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesSirenResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->disabled_by_default);
|
|
|
|
if (!this->tones.empty()) {
|
|
|
|
if (!this->tones.empty()) {
|
|
|
|
for (const auto &it : this->tones) {
|
|
|
|
for (const auto &it : this->tones) {
|
|
|
@@ -1462,7 +1614,9 @@ void ListEntitiesSirenResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_duration);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_duration);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_volume);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_volume);
|
|
|
|
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
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void SirenStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void SirenStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -1494,9 +1648,11 @@ bool SirenCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
case 8:
|
|
|
|
case 8:
|
|
|
|
this->has_volume = value.as_bool();
|
|
|
|
this->has_volume = value.as_bool();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
case 10:
|
|
|
|
case 10:
|
|
|
|
this->device_id = value.as_uint32();
|
|
|
|
this->device_id = value.as_uint32();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -1532,28 +1688,36 @@ void ListEntitiesLockResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_bool(8, this->assumed_state);
|
|
|
|
buffer.encode_bool(8, this->assumed_state);
|
|
|
|
buffer.encode_bool(9, this->supports_open);
|
|
|
|
buffer.encode_bool(9, this->supports_open);
|
|
|
|
buffer.encode_bool(10, this->requires_code);
|
|
|
|
buffer.encode_bool(10, this->requires_code);
|
|
|
|
buffer.encode_string(11, this->code_format);
|
|
|
|
buffer.encode_string(11, this->code_format);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(12, this->device_id);
|
|
|
|
buffer.encode_uint32(12, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesLockResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->assumed_state);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->assumed_state);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_open);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_open);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->requires_code);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->requires_code);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->code_format);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->code_format);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void LockStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void LockStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -1608,22 +1772,30 @@ void ListEntitiesButtonResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(9, this->device_id);
|
|
|
|
buffer.encode_uint32(9, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesButtonResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool ButtonCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
bool ButtonCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
switch (field_id) {
|
|
|
|
switch (field_id) {
|
|
|
@@ -1695,26 +1867,34 @@ void ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_bool(8, this->supports_pause);
|
|
|
|
buffer.encode_bool(8, this->supports_pause);
|
|
|
|
for (auto &it : this->supported_formats) {
|
|
|
|
for (auto &it : this->supported_formats) {
|
|
|
|
buffer.encode_message(9, it, true);
|
|
|
|
buffer.encode_message(9, it, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(10, this->device_id);
|
|
|
|
buffer.encode_uint32(10, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesMediaPlayerResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesMediaPlayerResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_pause);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_pause);
|
|
|
|
ProtoSize::add_repeated_message(total_size, 1, this->supported_formats);
|
|
|
|
ProtoSize::add_repeated_message(total_size, 1, this->supported_formats);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void MediaPlayerStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void MediaPlayerStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -1750,9 +1930,11 @@ bool MediaPlayerCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt val
|
|
|
|
case 9:
|
|
|
|
case 9:
|
|
|
|
this->announcement = value.as_bool();
|
|
|
|
this->announcement = value.as_bool();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
case 10:
|
|
|
|
case 10:
|
|
|
|
this->device_id = value.as_uint32();
|
|
|
|
this->device_id = value.as_uint32();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -2554,26 +2736,34 @@ void ListEntitiesAlarmControlPanelResponse::encode(ProtoWriteBuffer buffer) cons
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(8, this->supported_features);
|
|
|
|
buffer.encode_uint32(8, this->supported_features);
|
|
|
|
buffer.encode_bool(9, this->requires_code);
|
|
|
|
buffer.encode_bool(9, this->requires_code);
|
|
|
|
buffer.encode_bool(10, this->requires_code_to_arm);
|
|
|
|
buffer.encode_bool(10, this->requires_code_to_arm);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(11, this->device_id);
|
|
|
|
buffer.encode_uint32(11, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesAlarmControlPanelResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesAlarmControlPanelResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->supported_features);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->supported_features);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->requires_code);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->requires_code);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->requires_code_to_arm);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->requires_code_to_arm);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void AlarmControlPanelStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void AlarmControlPanelStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -2625,28 +2815,36 @@ void ListEntitiesTextResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(8, this->min_length);
|
|
|
|
buffer.encode_uint32(8, this->min_length);
|
|
|
|
buffer.encode_uint32(9, this->max_length);
|
|
|
|
buffer.encode_uint32(9, this->max_length);
|
|
|
|
buffer.encode_string(10, this->pattern);
|
|
|
|
buffer.encode_string(10, this->pattern);
|
|
|
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->mode));
|
|
|
|
buffer.encode_uint32(11, static_cast<uint32_t>(this->mode));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(12, this->device_id);
|
|
|
|
buffer.encode_uint32(12, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesTextResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesTextResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->min_length);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->min_length);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->max_length);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->max_length);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->pattern);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->pattern);
|
|
|
|
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode));
|
|
|
|
ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->mode));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void TextStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void TextStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -2697,20 +2895,28 @@ void ListEntitiesDateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesDateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesDateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void DateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void DateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -2764,20 +2970,28 @@ void ListEntitiesTimeResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesTimeResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesTimeResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void TimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void TimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -2831,21 +3045,27 @@ void ListEntitiesEventResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
for (auto &it : this->event_types) {
|
|
|
|
for (auto &it : this->event_types) {
|
|
|
|
buffer.encode_string(9, it, true);
|
|
|
|
buffer.encode_string(9, it, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(10, this->device_id);
|
|
|
|
buffer.encode_uint32(10, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
@@ -2854,7 +3074,9 @@ void ListEntitiesEventResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field_repeated(total_size, 1, it);
|
|
|
|
ProtoSize::add_string_field_repeated(total_size, 1, it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void EventResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void EventResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -2873,28 +3095,36 @@ void ListEntitiesValveResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
buffer.encode_bool(9, this->assumed_state);
|
|
|
|
buffer.encode_bool(9, this->assumed_state);
|
|
|
|
buffer.encode_bool(10, this->supports_position);
|
|
|
|
buffer.encode_bool(10, this->supports_position);
|
|
|
|
buffer.encode_bool(11, this->supports_stop);
|
|
|
|
buffer.encode_bool(11, this->supports_stop);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(12, this->device_id);
|
|
|
|
buffer.encode_uint32(12, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesValveResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesValveResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->assumed_state);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->assumed_state);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_position);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_position);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_stop);
|
|
|
|
ProtoSize::add_bool_field(total_size, 1, this->supports_stop);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ValveStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void ValveStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -2944,20 +3174,28 @@ void ListEntitiesDateTimeResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
buffer.encode_uint32(8, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesDateTimeResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesDateTimeResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void DateTimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void DateTimeStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -3001,22 +3239,30 @@ void ListEntitiesUpdateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_fixed32(2, this->key);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(3, this->name);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
buffer.encode_string(4, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
buffer.encode_string(5, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_bool(6, this->disabled_by_default);
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_uint32(7, static_cast<uint32_t>(this->entity_category));
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
buffer.encode_string(8, this->device_class);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(9, this->device_id);
|
|
|
|
buffer.encode_uint32(9, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void ListEntitiesUpdateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void ListEntitiesUpdateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->object_id);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->name);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->unique_id);
|
|
|
|
|
|
|
|
#ifdef USE_ENTITY_ICON
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->icon);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
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));
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->device_class);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void UpdateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
void UpdateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
|
buffer.encode_fixed32(1, this->key);
|
|
|
@@ -3029,7 +3275,9 @@ void UpdateStateResponse::encode(ProtoWriteBuffer buffer) const {
|
|
|
|
buffer.encode_string(8, this->title);
|
|
|
|
buffer.encode_string(8, this->title);
|
|
|
|
buffer.encode_string(9, this->release_summary);
|
|
|
|
buffer.encode_string(9, this->release_summary);
|
|
|
|
buffer.encode_string(10, this->release_url);
|
|
|
|
buffer.encode_string(10, this->release_url);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
buffer.encode_uint32(11, this->device_id);
|
|
|
|
buffer.encode_uint32(11, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void UpdateStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
void UpdateStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
|
ProtoSize::add_fixed_field<4>(total_size, 1, this->key != 0);
|
|
|
@@ -3042,7 +3290,9 @@ void UpdateStateResponse::calculate_size(uint32_t &total_size) const {
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->title);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->title);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->release_summary);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->release_summary);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->release_url);
|
|
|
|
ProtoSize::add_string_field(total_size, 1, this->release_url);
|
|
|
|
|
|
|
|
#ifdef USE_DEVICES
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
ProtoSize::add_uint32_field(total_size, 1, this->device_id);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
|
|
|
switch (field_id) {
|
|
|
|
switch (field_id) {
|
|
|
|