diff --git a/esphome/components/api/api_pb2.cpp b/esphome/components/api/api_pb2.cpp index a8a1d641f0..3f19dc5313 100644 --- a/esphome/components/api/api_pb2.cpp +++ b/esphome/components/api/api_pb2.cpp @@ -2565,6 +2565,10 @@ bool ListEntitiesSensorResponse::decode_varint(uint32_t field_id, ProtoVarInt va this->entity_category = value.as_enum(); return true; } + case 14: { + this->device_uid = value.as_uint32(); + return true; + } default: return false; } @@ -2595,10 +2599,6 @@ bool ListEntitiesSensorResponse::decode_length(uint32_t field_id, ProtoLengthDel this->device_class = value.as_string(); return true; } - case 14: { - this->device_uid = value.as_uint32(); - return true; - } default: return false; } @@ -4853,6 +4853,10 @@ bool ListEntitiesSelectResponse::decode_varint(uint32_t field_id, ProtoVarInt va this->entity_category = value.as_enum(); return true; } + case 9: { + this->device_uid = value.as_uint32(); + return true; + } default: return false; } @@ -4879,10 +4883,6 @@ bool ListEntitiesSelectResponse::decode_length(uint32_t field_id, ProtoLengthDel this->options.push_back(value.as_string()); return true; } - case 9: { - this->device_uid = value.as_uint32(); - return true; - } default: return false; } diff --git a/esphome/config_validation.py b/esphome/config_validation.py index c5feeea5b9..4eef985b7c 100644 --- a/esphome/config_validation.py +++ b/esphome/config_validation.py @@ -21,7 +21,7 @@ from esphome.const import ( CONF_COMMAND_RETAIN, CONF_COMMAND_TOPIC, CONF_DAY, - CONF_DEVICE_UID, + CONF_DEVICE_ID, CONF_DISABLED_BY_DEFAULT, CONF_DISCOVERY, CONF_ENTITY_CATEGORY, @@ -348,7 +348,7 @@ def icon(value): ) -def sub_device_uid(value): +def sub_device_id(value): devices_ns = cg.esphome_ns.namespace("devices") SubDevice = devices_ns.class_("SubDevice") validator = use_id(SubDevice) @@ -1832,7 +1832,7 @@ ENTITY_BASE_SCHEMA = Schema( Optional(CONF_DISABLED_BY_DEFAULT, default=False): boolean, Optional(CONF_ICON): icon, Optional(CONF_ENTITY_CATEGORY): entity_category, - Optional(CONF_DEVICE_UID): sub_device_uid, + Optional(CONF_DEVICE_ID): sub_device_id, } ) diff --git a/esphome/const.py b/esphome/const.py index ddd02d8b7e..22320e824b 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -216,7 +216,7 @@ CONF_DEST = "dest" CONF_DEVICE = "device" CONF_DEVICE_CLASS = "device_class" CONF_DEVICE_FACTOR = "device_factor" -CONF_DEVICE_UID = "device_uid" +CONF_DEVICE_ID = "device_id" CONF_DIELECTRIC_CONSTANT = "dielectric_constant" CONF_DIMENSIONS = "dimensions" CONF_DIO_PIN = "dio_pin" diff --git a/tests/components/device/common.yaml b/tests/components/device/common.yaml index 879a7591b1..232bb631c9 100644 --- a/tests/components/device/common.yaml +++ b/tests/components/device/common.yaml @@ -8,4 +8,4 @@ binary_sensor: - platform: template name: Other device sensor - device_uid: other_device + device_id: other_device