mirror of
https://github.com/esphome/esphome.git
synced 2026-10-05 18:41:32 +00:00
[core] Use ESPDEPRECATED macro for deprecation warnings (#11755)
This commit is contained in:
@@ -61,9 +61,10 @@ class EntityBase {
|
||||
}
|
||||
|
||||
// Get/set this entity's icon
|
||||
[[deprecated("Use get_icon_ref() instead for better performance (avoids string copy). Will stop working in ESPHome "
|
||||
"2026.5.0")]] std::string
|
||||
get_icon() const;
|
||||
ESPDEPRECATED(
|
||||
"Use get_icon_ref() instead for better performance (avoids string copy). Will be removed in ESPHome 2026.5.0",
|
||||
"2025.11.0")
|
||||
std::string get_icon() const;
|
||||
void set_icon(const char *icon);
|
||||
StringRef get_icon_ref() const {
|
||||
static constexpr auto EMPTY_STRING = StringRef::from_lit("");
|
||||
@@ -160,9 +161,10 @@ class EntityBase {
|
||||
class EntityBase_DeviceClass { // NOLINT(readability-identifier-naming)
|
||||
public:
|
||||
/// Get the device class, using the manual override if set.
|
||||
[[deprecated("Use get_device_class_ref() instead for better performance (avoids string copy). Will stop working in "
|
||||
"ESPHome 2026.5.0")]] std::string
|
||||
get_device_class();
|
||||
ESPDEPRECATED("Use get_device_class_ref() instead for better performance (avoids string copy). Will be removed in "
|
||||
"ESPHome 2026.5.0",
|
||||
"2025.11.0")
|
||||
std::string get_device_class();
|
||||
/// Manually set the device class.
|
||||
void set_device_class(const char *device_class);
|
||||
/// Get the device class as StringRef
|
||||
@@ -178,9 +180,10 @@ class EntityBase_DeviceClass { // NOLINT(readability-identifier-naming)
|
||||
class EntityBase_UnitOfMeasurement { // NOLINT(readability-identifier-naming)
|
||||
public:
|
||||
/// Get the unit of measurement, using the manual override if set.
|
||||
[[deprecated("Use get_unit_of_measurement_ref() instead for better performance (avoids string copy). Will stop "
|
||||
"working in ESPHome 2026.5.0")]] std::string
|
||||
get_unit_of_measurement();
|
||||
ESPDEPRECATED("Use get_unit_of_measurement_ref() instead for better performance (avoids string copy). Will be "
|
||||
"removed in ESPHome 2026.5.0",
|
||||
"2025.11.0")
|
||||
std::string get_unit_of_measurement();
|
||||
/// Manually set the unit of measurement.
|
||||
void set_unit_of_measurement(const char *unit_of_measurement);
|
||||
/// Get the unit of measurement as StringRef
|
||||
|
||||
Reference in New Issue
Block a user