mirror of https://github.com/esphome/esphome.git
Rename to disabled_by_default
This commit is contained in:
parent
e2e4fe4171
commit
97a560eb1c
|
@ -214,7 +214,7 @@ message ListEntitiesBinarySensorResponse {
|
|||
|
||||
string device_class = 5;
|
||||
bool is_status_binary_sensor = 6;
|
||||
bool disabled_default = 7;
|
||||
bool disabled_by_default = 7;
|
||||
}
|
||||
message BinarySensorStateResponse {
|
||||
option (id) = 21;
|
||||
|
@ -244,7 +244,7 @@ message ListEntitiesCoverResponse {
|
|||
bool supports_position = 6;
|
||||
bool supports_tilt = 7;
|
||||
string device_class = 8;
|
||||
bool disabled_default = 9;
|
||||
bool disabled_by_default = 9;
|
||||
}
|
||||
|
||||
enum LegacyCoverState {
|
||||
|
@ -312,7 +312,7 @@ message ListEntitiesFanResponse {
|
|||
bool supports_speed = 6;
|
||||
bool supports_direction = 7;
|
||||
int32 supported_speed_count = 8;
|
||||
bool disabled_default = 9;
|
||||
bool disabled_by_default = 9;
|
||||
}
|
||||
enum FanSpeed {
|
||||
FAN_SPEED_LOW = 0;
|
||||
|
@ -387,7 +387,7 @@ message ListEntitiesLightResponse {
|
|||
float min_mireds = 9;
|
||||
float max_mireds = 10;
|
||||
repeated string effects = 11;
|
||||
bool disabled_default = 13;
|
||||
bool disabled_by_default = 13;
|
||||
}
|
||||
message LightStateResponse {
|
||||
option (id) = 24;
|
||||
|
@ -473,7 +473,7 @@ message ListEntitiesSensorResponse {
|
|||
string device_class = 9;
|
||||
SensorStateClass state_class = 10;
|
||||
SensorLastResetType last_reset_type = 11;
|
||||
bool disabled_default = 12;
|
||||
bool disabled_by_default = 12;
|
||||
}
|
||||
message SensorStateResponse {
|
||||
option (id) = 25;
|
||||
|
@ -501,7 +501,7 @@ message ListEntitiesSwitchResponse {
|
|||
|
||||
string icon = 5;
|
||||
bool assumed_state = 6;
|
||||
bool disabled_default = 7;
|
||||
bool disabled_by_default = 7;
|
||||
}
|
||||
message SwitchStateResponse {
|
||||
option (id) = 26;
|
||||
|
@ -534,7 +534,7 @@ message ListEntitiesTextSensorResponse {
|
|||
string unique_id = 4;
|
||||
|
||||
string icon = 5;
|
||||
bool disabled_default = 6;
|
||||
bool disabled_by_default = 6;
|
||||
}
|
||||
message TextSensorStateResponse {
|
||||
option (id) = 27;
|
||||
|
@ -694,7 +694,7 @@ message ListEntitiesCameraResponse {
|
|||
fixed32 key = 2;
|
||||
string name = 3;
|
||||
string unique_id = 4;
|
||||
bool disabled_default = 5;
|
||||
bool disabled_by_default = 5;
|
||||
}
|
||||
|
||||
message CameraImageResponse {
|
||||
|
@ -787,7 +787,7 @@ message ListEntitiesClimateResponse {
|
|||
repeated string supported_custom_fan_modes = 15;
|
||||
repeated ClimatePreset supported_presets = 16;
|
||||
repeated string supported_custom_presets = 17;
|
||||
bool disabled_default = 18;
|
||||
bool disabled_by_default = 18;
|
||||
}
|
||||
message ClimateStateResponse {
|
||||
option (id) = 47;
|
||||
|
@ -855,7 +855,7 @@ message ListEntitiesNumberResponse {
|
|||
float min_value = 6;
|
||||
float max_value = 7;
|
||||
float step = 8;
|
||||
bool disabled_default = 9;
|
||||
bool disabled_by_default = 9;
|
||||
}
|
||||
message NumberStateResponse {
|
||||
option (id) = 50;
|
||||
|
@ -892,7 +892,7 @@ message ListEntitiesSelectResponse {
|
|||
|
||||
string icon = 5;
|
||||
repeated string options = 6;
|
||||
bool disabled_default = 7;
|
||||
bool disabled_by_default = 7;
|
||||
}
|
||||
message SelectStateResponse {
|
||||
option (id) = 53;
|
||||
|
|
|
@ -176,7 +176,7 @@ bool APIConnection::send_binary_sensor_info(binary_sensor::BinarySensor *binary_
|
|||
msg.unique_id = get_default_unique_id("binary_sensor", binary_sensor);
|
||||
msg.device_class = binary_sensor->get_device_class();
|
||||
msg.is_status_binary_sensor = binary_sensor->is_status_binary_sensor();
|
||||
msg.disabled_default = binary_sensor->is_disabled_default();
|
||||
msg.disabled_by_default = binary_sensor->is_disabled_by_default();
|
||||
return this->send_list_entities_binary_sensor_response(msg);
|
||||
}
|
||||
#endif
|
||||
|
@ -208,7 +208,7 @@ bool APIConnection::send_cover_info(cover::Cover *cover) {
|
|||
msg.supports_position = traits.get_supports_position();
|
||||
msg.supports_tilt = traits.get_supports_tilt();
|
||||
msg.device_class = cover->get_device_class();
|
||||
msg.disabled_default = cover->is_disabled_default();
|
||||
msg.disabled_by_default = cover->is_disabled_by_default();
|
||||
return this->send_list_entities_cover_response(msg);
|
||||
}
|
||||
void APIConnection::cover_command(const CoverCommandRequest &msg) {
|
||||
|
@ -270,7 +270,7 @@ bool APIConnection::send_fan_info(fan::FanState *fan) {
|
|||
msg.supports_speed = traits.supports_speed();
|
||||
msg.supports_direction = traits.supports_direction();
|
||||
msg.supported_speed_count = traits.supported_speed_count();
|
||||
msg.disabled_default = fan->is_disabled_default();
|
||||
msg.disabled_by_default = fan->is_disabled_by_default();
|
||||
return this->send_list_entities_fan_response(msg);
|
||||
}
|
||||
void APIConnection::fan_command(const FanCommandRequest &msg) {
|
||||
|
@ -338,7 +338,7 @@ bool APIConnection::send_light_info(light::LightState *light) {
|
|||
msg.name = light->get_name();
|
||||
msg.unique_id = get_default_unique_id("light", light);
|
||||
|
||||
msg.disabled_default = light->is_disabled_default();
|
||||
msg.disabled_by_default = light->is_disabled_by_default();
|
||||
|
||||
for (auto mode : traits.get_supported_color_modes())
|
||||
msg.supported_color_modes.push_back(static_cast<enums::ColorMode>(mode));
|
||||
|
@ -425,7 +425,7 @@ bool APIConnection::send_sensor_info(sensor::Sensor *sensor) {
|
|||
msg.device_class = sensor->get_device_class();
|
||||
msg.state_class = static_cast<enums::SensorStateClass>(sensor->state_class);
|
||||
msg.last_reset_type = static_cast<enums::SensorLastResetType>(sensor->last_reset_type);
|
||||
msg.disabled_default = sensor->is_disabled_default();
|
||||
msg.disabled_by_default = sensor->is_disabled_by_default();
|
||||
|
||||
return this->send_list_entities_sensor_response(msg);
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ bool APIConnection::send_switch_info(switch_::Switch *a_switch) {
|
|||
msg.unique_id = get_default_unique_id("switch", a_switch);
|
||||
msg.icon = a_switch->get_icon();
|
||||
msg.assumed_state = a_switch->assumed_state();
|
||||
msg.disabled_default = a_switch->is_disabled_default();
|
||||
msg.disabled_by_default = a_switch->is_disabled_by_default();
|
||||
return this->send_list_entities_switch_response(msg);
|
||||
}
|
||||
void APIConnection::switch_command(const SwitchCommandRequest &msg) {
|
||||
|
@ -484,7 +484,7 @@ bool APIConnection::send_text_sensor_info(text_sensor::TextSensor *text_sensor)
|
|||
if (msg.unique_id.empty())
|
||||
msg.unique_id = get_default_unique_id("text_sensor", text_sensor);
|
||||
msg.icon = text_sensor->get_icon();
|
||||
msg.disabled_default = text_sensor->is_disabled_default();
|
||||
msg.disabled_by_default = text_sensor->is_disabled_by_default();
|
||||
return this->send_list_entities_text_sensor_response(msg);
|
||||
}
|
||||
#endif
|
||||
|
@ -529,7 +529,7 @@ bool APIConnection::send_climate_info(climate::Climate *climate) {
|
|||
msg.name = climate->get_name();
|
||||
msg.unique_id = get_default_unique_id("climate", climate);
|
||||
|
||||
msg.disabled_default = climate->is_disabled_default();
|
||||
msg.disabled_by_default = climate->is_disabled_by_default();
|
||||
|
||||
msg.supports_current_temperature = traits.get_supports_current_temperature();
|
||||
msg.supports_two_point_target_temperature = traits.get_supports_two_point_target_temperature();
|
||||
|
@ -603,7 +603,7 @@ bool APIConnection::send_number_info(number::Number *number) {
|
|||
msg.name = number->get_name();
|
||||
msg.unique_id = get_default_unique_id("number", number);
|
||||
msg.icon = number->traits.get_icon();
|
||||
msg.disabled_default = number->is_disabled_default();
|
||||
msg.disabled_by_default = number->is_disabled_by_default();
|
||||
|
||||
msg.min_value = number->traits.get_min_value();
|
||||
msg.max_value = number->traits.get_max_value();
|
||||
|
@ -640,7 +640,7 @@ bool APIConnection::send_select_info(select::Select *select) {
|
|||
msg.name = select->get_name();
|
||||
msg.unique_id = get_default_unique_id("select", select);
|
||||
msg.icon = select->traits.get_icon();
|
||||
msg.disabled_default = select->is_disabled_default();
|
||||
msg.disabled_by_default = select->is_disabled_by_default();
|
||||
|
||||
for (const auto &option : select->traits.get_options())
|
||||
msg.options.push_back(option);
|
||||
|
@ -672,7 +672,7 @@ bool APIConnection::send_camera_info(esp32_camera::ESP32Camera *camera) {
|
|||
msg.object_id = camera->get_object_id();
|
||||
msg.name = camera->get_name();
|
||||
msg.unique_id = get_default_unique_id("camera", camera);
|
||||
msg.disabled_default = camera->is_disabled_default();
|
||||
msg.disabled_by_default = camera->is_disabled_by_default();
|
||||
return this->send_list_entities_camera_response(msg);
|
||||
}
|
||||
void APIConnection::camera_image(const CameraImageRequest &msg) {
|
||||
|
|
|
@ -476,7 +476,7 @@ bool ListEntitiesBinarySensorResponse::decode_varint(uint32_t field_id, ProtoVar
|
|||
return true;
|
||||
}
|
||||
case 7: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -522,7 +522,7 @@ void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
buffer.encode_string(4, this->unique_id);
|
||||
buffer.encode_string(5, this->device_class);
|
||||
buffer.encode_bool(6, this->is_status_binary_sensor);
|
||||
buffer.encode_bool(7, this->disabled_default);
|
||||
buffer.encode_bool(7, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -552,8 +552,8 @@ void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const {
|
|||
out.append(YESNO(this->is_status_binary_sensor));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -618,7 +618,7 @@ bool ListEntitiesCoverResponse::decode_varint(uint32_t field_id, ProtoVarInt val
|
|||
return true;
|
||||
}
|
||||
case 9: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -666,7 +666,7 @@ void ListEntitiesCoverResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
buffer.encode_bool(6, this->supports_position);
|
||||
buffer.encode_bool(7, this->supports_tilt);
|
||||
buffer.encode_string(8, this->device_class);
|
||||
buffer.encode_bool(9, this->disabled_default);
|
||||
buffer.encode_bool(9, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesCoverResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -704,8 +704,8 @@ void ListEntitiesCoverResponse::dump_to(std::string &out) const {
|
|||
out.append("'").append(this->device_class).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -887,7 +887,7 @@ bool ListEntitiesFanResponse::decode_varint(uint32_t field_id, ProtoVarInt value
|
|||
return true;
|
||||
}
|
||||
case 9: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -931,7 +931,7 @@ void ListEntitiesFanResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
buffer.encode_bool(6, this->supports_speed);
|
||||
buffer.encode_bool(7, this->supports_direction);
|
||||
buffer.encode_int32(8, this->supported_speed_count);
|
||||
buffer.encode_bool(9, this->disabled_default);
|
||||
buffer.encode_bool(9, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesFanResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -970,8 +970,8 @@ void ListEntitiesFanResponse::dump_to(std::string &out) const {
|
|||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -1191,7 +1191,7 @@ bool ListEntitiesLightResponse::decode_varint(uint32_t field_id, ProtoVarInt val
|
|||
return true;
|
||||
}
|
||||
case 13: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -1255,7 +1255,7 @@ void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
for (auto &it : this->effects) {
|
||||
buffer.encode_string(11, it, true);
|
||||
}
|
||||
buffer.encode_bool(13, this->disabled_default);
|
||||
buffer.encode_bool(13, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesLightResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -1315,8 +1315,8 @@ void ListEntitiesLightResponse::dump_to(std::string &out) const {
|
|||
out.append("\n");
|
||||
}
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -1769,7 +1769,7 @@ bool ListEntitiesSensorResponse::decode_varint(uint32_t field_id, ProtoVarInt va
|
|||
return true;
|
||||
}
|
||||
case 12: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -1828,7 +1828,7 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
buffer.encode_string(9, this->device_class);
|
||||
buffer.encode_enum<enums::SensorStateClass>(10, this->state_class);
|
||||
buffer.encode_enum<enums::SensorLastResetType>(11, this->last_reset_type);
|
||||
buffer.encode_bool(12, this->disabled_default);
|
||||
buffer.encode_bool(12, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesSensorResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -1879,8 +1879,8 @@ void ListEntitiesSensorResponse::dump_to(std::string &out) const {
|
|||
out.append(proto_enum_to_string<enums::SensorLastResetType>(this->last_reset_type));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -1938,7 +1938,7 @@ bool ListEntitiesSwitchResponse::decode_varint(uint32_t field_id, ProtoVarInt va
|
|||
return true;
|
||||
}
|
||||
case 7: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -1984,7 +1984,7 @@ void ListEntitiesSwitchResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
buffer.encode_string(4, this->unique_id);
|
||||
buffer.encode_string(5, this->icon);
|
||||
buffer.encode_bool(6, this->assumed_state);
|
||||
buffer.encode_bool(7, this->disabled_default);
|
||||
buffer.encode_bool(7, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesSwitchResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -2014,8 +2014,8 @@ void ListEntitiesSwitchResponse::dump_to(std::string &out) const {
|
|||
out.append(YESNO(this->assumed_state));
|
||||
out.append("\n");
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -2096,7 +2096,7 @@ void SwitchCommandRequest::dump_to(std::string &out) const {
|
|||
bool ListEntitiesTextSensorResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
switch (field_id) {
|
||||
case 6: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -2141,7 +2141,7 @@ void ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
buffer.encode_string(3, this->name);
|
||||
buffer.encode_string(4, this->unique_id);
|
||||
buffer.encode_string(5, this->icon);
|
||||
buffer.encode_bool(6, this->disabled_default);
|
||||
buffer.encode_bool(6, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesTextSensorResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -2167,8 +2167,8 @@ void ListEntitiesTextSensorResponse::dump_to(std::string &out) const {
|
|||
out.append("'").append(this->icon).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -2768,7 +2768,7 @@ void ExecuteServiceRequest::dump_to(std::string &out) const {
|
|||
bool ListEntitiesCameraResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
switch (field_id) {
|
||||
case 5: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -2808,7 +2808,7 @@ void ListEntitiesCameraResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
buffer.encode_fixed32(2, this->key);
|
||||
buffer.encode_string(3, this->name);
|
||||
buffer.encode_string(4, this->unique_id);
|
||||
buffer.encode_bool(5, this->disabled_default);
|
||||
buffer.encode_bool(5, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesCameraResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -2830,8 +2830,8 @@ void ListEntitiesCameraResponse::dump_to(std::string &out) const {
|
|||
out.append("'").append(this->unique_id).append("'");
|
||||
out.append("\n");
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -2952,7 +2952,7 @@ bool ListEntitiesClimateResponse::decode_varint(uint32_t field_id, ProtoVarInt v
|
|||
return true;
|
||||
}
|
||||
case 18: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -3037,7 +3037,7 @@ void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
for (auto &it : this->supported_custom_presets) {
|
||||
buffer.encode_string(17, it, true);
|
||||
}
|
||||
buffer.encode_bool(18, this->disabled_default);
|
||||
buffer.encode_bool(18, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesClimateResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -3126,8 +3126,8 @@ void ListEntitiesClimateResponse::dump_to(std::string &out) const {
|
|||
out.append("\n");
|
||||
}
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -3497,7 +3497,7 @@ void ClimateCommandRequest::dump_to(std::string &out) const {
|
|||
bool ListEntitiesNumberResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
switch (field_id) {
|
||||
case 9: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -3557,7 +3557,7 @@ void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
buffer.encode_float(6, this->min_value);
|
||||
buffer.encode_float(7, this->max_value);
|
||||
buffer.encode_float(8, this->step);
|
||||
buffer.encode_bool(9, this->disabled_default);
|
||||
buffer.encode_bool(9, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesNumberResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -3598,8 +3598,8 @@ void ListEntitiesNumberResponse::dump_to(std::string &out) const {
|
|||
out.append(buffer);
|
||||
out.append("\n");
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
@ -3685,7 +3685,7 @@ void NumberCommandRequest::dump_to(std::string &out) const {
|
|||
bool ListEntitiesSelectResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
|
||||
switch (field_id) {
|
||||
case 7: {
|
||||
this->disabled_default = value.as_bool();
|
||||
this->disabled_by_default = value.as_bool();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
@ -3737,7 +3737,7 @@ void ListEntitiesSelectResponse::encode(ProtoWriteBuffer buffer) const {
|
|||
for (auto &it : this->options) {
|
||||
buffer.encode_string(6, it, true);
|
||||
}
|
||||
buffer.encode_bool(7, this->disabled_default);
|
||||
buffer.encode_bool(7, this->disabled_by_default);
|
||||
}
|
||||
void ListEntitiesSelectResponse::dump_to(std::string &out) const {
|
||||
char buffer[64];
|
||||
|
@ -3769,8 +3769,8 @@ void ListEntitiesSelectResponse::dump_to(std::string &out) const {
|
|||
out.append("\n");
|
||||
}
|
||||
|
||||
out.append(" disabled_default: ");
|
||||
out.append(YESNO(this->disabled_default));
|
||||
out.append(" disabled_by_default: ");
|
||||
out.append(YESNO(this->disabled_by_default));
|
||||
out.append("\n");
|
||||
out.append("}");
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ class ListEntitiesBinarySensorResponse : public ProtoMessage {
|
|||
std::string unique_id{};
|
||||
std::string device_class{};
|
||||
bool is_status_binary_sensor{false};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -271,7 +271,7 @@ class ListEntitiesCoverResponse : public ProtoMessage {
|
|||
bool supports_position{false};
|
||||
bool supports_tilt{false};
|
||||
std::string device_class{};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -321,7 +321,7 @@ class ListEntitiesFanResponse : public ProtoMessage {
|
|||
bool supports_speed{false};
|
||||
bool supports_direction{false};
|
||||
int32_t supported_speed_count{0};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -379,7 +379,7 @@ class ListEntitiesLightResponse : public ProtoMessage {
|
|||
float min_mireds{0.0f};
|
||||
float max_mireds{0.0f};
|
||||
std::vector<std::string> effects{};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -461,7 +461,7 @@ class ListEntitiesSensorResponse : public ProtoMessage {
|
|||
std::string device_class{};
|
||||
enums::SensorStateClass state_class{};
|
||||
enums::SensorLastResetType last_reset_type{};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -490,7 +490,7 @@ class ListEntitiesSwitchResponse : public ProtoMessage {
|
|||
std::string unique_id{};
|
||||
std::string icon{};
|
||||
bool assumed_state{false};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -528,7 +528,7 @@ class ListEntitiesTextSensorResponse : public ProtoMessage {
|
|||
std::string name{};
|
||||
std::string unique_id{};
|
||||
std::string icon{};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -707,7 +707,7 @@ class ListEntitiesCameraResponse : public ProtoMessage {
|
|||
uint32_t key{0};
|
||||
std::string name{};
|
||||
std::string unique_id{};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -758,7 +758,7 @@ class ListEntitiesClimateResponse : public ProtoMessage {
|
|||
std::vector<std::string> supported_custom_fan_modes{};
|
||||
std::vector<enums::ClimatePreset> supported_presets{};
|
||||
std::vector<std::string> supported_custom_presets{};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -831,7 +831,7 @@ class ListEntitiesNumberResponse : public ProtoMessage {
|
|||
float min_value{0.0f};
|
||||
float max_value{0.0f};
|
||||
float step{0.0f};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
@ -870,7 +870,7 @@ class ListEntitiesSelectResponse : public ProtoMessage {
|
|||
std::string unique_id{};
|
||||
std::string icon{};
|
||||
std::vector<std::string> options{};
|
||||
bool disabled_default{false};
|
||||
bool disabled_by_default{false};
|
||||
void encode(ProtoWriteBuffer buffer) const override;
|
||||
void dump_to(std::string &out) const override;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from esphome.components import mqtt
|
|||
from esphome.const import (
|
||||
CONF_DELAY,
|
||||
CONF_DEVICE_CLASS,
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_FILTERS,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
|
@ -378,7 +378,7 @@ BINARY_SENSOR_SCHEMA = cv.NAMEABLE_SCHEMA.extend(cv.MQTT_COMPONENT_SCHEMA).exten
|
|||
|
||||
async def setup_binary_sensor_core_(var, config):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
if CONF_DEVICE_CLASS in config:
|
||||
|
|
|
@ -6,7 +6,7 @@ from esphome.const import (
|
|||
CONF_AWAY,
|
||||
CONF_CUSTOM_FAN_MODE,
|
||||
CONF_CUSTOM_PRESET,
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
CONF_MAX_TEMPERATURE,
|
||||
|
@ -105,7 +105,7 @@ CLIMATE_SCHEMA = cv.NAMEABLE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).ext
|
|||
|
||||
async def setup_climate_core_(var, config):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
visual = config[CONF_VISUAL]
|
||||
|
|
|
@ -4,7 +4,7 @@ from esphome import automation
|
|||
from esphome.automation import maybe_simple_id, Condition
|
||||
from esphome.components import mqtt
|
||||
from esphome.const import (
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
CONF_DEVICE_CLASS,
|
||||
|
@ -76,7 +76,7 @@ COVER_SCHEMA = cv.NAMEABLE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).exten
|
|||
|
||||
async def setup_cover_core_(var, config):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
if CONF_DEVICE_CLASS in config:
|
||||
|
|
|
@ -4,7 +4,7 @@ from esphome import automation
|
|||
from esphome.automation import maybe_simple_id
|
||||
from esphome.components import mqtt
|
||||
from esphome.const import (
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
CONF_MQTT_ID,
|
||||
|
@ -67,7 +67,7 @@ FAN_SCHEMA = cv.NAMEABLE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).extend(
|
|||
|
||||
async def setup_fan_core_(var, config):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from esphome.components import mqtt, power_supply
|
|||
from esphome.const import (
|
||||
CONF_COLOR_CORRECT,
|
||||
CONF_DEFAULT_TRANSITION_LENGTH,
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_EFFECTS,
|
||||
CONF_GAMMA_CORRECT,
|
||||
CONF_ID,
|
||||
|
@ -122,7 +122,7 @@ def validate_color_temperature_channels(value):
|
|||
|
||||
|
||||
async def setup_light_core_(light_var, output_var, config):
|
||||
cg.add(light_var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(light_var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
cg.add(light_var.set_restore_mode(config[CONF_RESTORE_MODE]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(light_var.set_internal(config[CONF_INTERNAL]))
|
||||
|
|
|
@ -6,7 +6,7 @@ from esphome.components import mqtt
|
|||
from esphome.const import (
|
||||
CONF_ABOVE,
|
||||
CONF_BELOW,
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_ICON,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
|
@ -72,7 +72,7 @@ async def setup_number_core_(
|
|||
var, config, *, min_value: float, max_value: float, step: Optional[float]
|
||||
):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import esphome.config_validation as cv
|
|||
from esphome import automation
|
||||
from esphome.components import mqtt
|
||||
from esphome.const import (
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_ICON,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
|
@ -51,7 +51,7 @@ SELECT_SCHEMA = cv.NAMEABLE_SCHEMA.extend(cv.MQTT_COMPONENT_SCHEMA).extend(
|
|||
|
||||
async def setup_select_core_(var, config, *, options: List[str]):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ from esphome.const import (
|
|||
CONF_ACCURACY_DECIMALS,
|
||||
CONF_ALPHA,
|
||||
CONF_BELOW,
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_EXPIRE_AFTER,
|
||||
CONF_FILTERS,
|
||||
CONF_FROM,
|
||||
|
@ -495,7 +495,7 @@ async def build_filters(config):
|
|||
|
||||
async def setup_sensor_core_(var, config):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
if CONF_DEVICE_CLASS in config:
|
||||
|
|
|
@ -4,7 +4,7 @@ from esphome import automation
|
|||
from esphome.automation import Condition, maybe_simple_id
|
||||
from esphome.components import mqtt
|
||||
from esphome.const import (
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_ICON,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
|
@ -60,7 +60,7 @@ SWITCH_SCHEMA = cv.NAMEABLE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).exte
|
|||
|
||||
async def setup_switch_core_(var, config):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
if CONF_ICON in config:
|
||||
|
|
|
@ -3,7 +3,7 @@ import esphome.config_validation as cv
|
|||
from esphome import automation
|
||||
from esphome.components import mqtt
|
||||
from esphome.const import (
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_ICON,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
|
@ -49,7 +49,7 @@ TEXT_SENSOR_SCHEMA = cv.NAMEABLE_SCHEMA.extend(cv.MQTT_COMPONENT_SCHEMA).extend(
|
|||
|
||||
async def setup_text_sensor_core_(var, config):
|
||||
cg.add(var.set_name(config[CONF_NAME]))
|
||||
cg.add(var.set_disabled_default(config[CONF_DISABLED_DEFAULT]))
|
||||
cg.add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
|
||||
if CONF_INTERNAL in config:
|
||||
cg.add(var.set_internal(config[CONF_INTERNAL]))
|
||||
if CONF_ICON in config:
|
||||
|
|
|
@ -15,7 +15,7 @@ from esphome.const import (
|
|||
ALLOWED_NAME_CHARS,
|
||||
CONF_AVAILABILITY,
|
||||
CONF_COMMAND_TOPIC,
|
||||
CONF_DISABLED_DEFAULT,
|
||||
CONF_DISABLED_BY_DEFAULT,
|
||||
CONF_DISCOVERY,
|
||||
CONF_ID,
|
||||
CONF_INTERNAL,
|
||||
|
@ -1576,7 +1576,7 @@ NAMEABLE_SCHEMA = Schema(
|
|||
{
|
||||
Optional(CONF_NAME): string,
|
||||
Optional(CONF_INTERNAL): boolean,
|
||||
Optional(CONF_DISABLED_DEFAULT, default=False): boolean,
|
||||
Optional(CONF_DISABLED_BY_DEFAULT, default=False): boolean,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ CONF_DIO_PIN = "dio_pin"
|
|||
CONF_DIR_PIN = "dir_pin"
|
||||
CONF_DIRECTION = "direction"
|
||||
CONF_DIRECTION_OUTPUT = "direction_output"
|
||||
CONF_DISABLED_DEFAULT = "disabled_default"
|
||||
CONF_DISABLED_BY_DEFAULT = "disabled_by_default"
|
||||
CONF_DISCOVERY = "discovery"
|
||||
CONF_DISCOVERY_PREFIX = "discovery_prefix"
|
||||
CONF_DISCOVERY_RETAIN = "discovery_retain"
|
||||
|
|
|
@ -187,7 +187,7 @@ void Nameable::calc_object_id_() {
|
|||
}
|
||||
uint32_t Nameable::get_object_id_hash() { return this->object_id_hash_; }
|
||||
|
||||
bool Nameable::is_disabled_default() const { return this->disabled_default_; }
|
||||
void Nameable::set_disabled_default(bool disabled_default) { this->disabled_default_ = disabled_default; }
|
||||
bool Nameable::is_disabled_by_default() const { return this->disabled_by_default_; }
|
||||
void Nameable::set_disabled_by_default(bool disabled_by_default) { this->disabled_by_default_ = disabled_by_default; }
|
||||
|
||||
} // namespace esphome
|
||||
|
|
|
@ -256,8 +256,8 @@ class Nameable {
|
|||
bool is_internal() const;
|
||||
void set_internal(bool internal);
|
||||
|
||||
bool is_disabled_default() const;
|
||||
void set_disabled_default(bool disabled_default);
|
||||
bool is_disabled_by_default() const;
|
||||
void set_disabled_by_default(bool disabled_by_default);
|
||||
|
||||
protected:
|
||||
virtual uint32_t hash_base() = 0;
|
||||
|
@ -268,7 +268,7 @@ class Nameable {
|
|||
std::string object_id_;
|
||||
uint32_t object_id_hash_;
|
||||
bool internal_{false};
|
||||
bool disabled_default_{false};
|
||||
bool disabled_by_default_{false};
|
||||
};
|
||||
|
||||
} // namespace esphome
|
||||
|
|
|
@ -137,10 +137,13 @@ sensor:
|
|||
name: "SelecEM2M Frequency"
|
||||
maximum_demand_active_power:
|
||||
name: "SelecEM2M Maximum Demand Active Power"
|
||||
disabled_by_default: true
|
||||
maximum_demand_reactive_power:
|
||||
name: "SelecEM2M Maximum Demand Reactive Power"
|
||||
disabled_by_default: true
|
||||
maximum_demand_apparent_power:
|
||||
name: "SelecEM2M Maximum Demand Apparent Power"
|
||||
disabled_by_default: true
|
||||
|
||||
- platform: t6615
|
||||
uart_id: uart2
|
||||
|
|
Loading…
Reference in New Issue