Remove deprecated attribute from virtual entity methods (#3056)

This commit is contained in:
Oxan van Leeuwen 2022-01-16 23:40:15 +01:00 committed by GitHub
parent 1ea6f957bc
commit 89e7448007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 11 deletions

View File

@ -74,8 +74,10 @@ class BinarySensor : public EntityBase {
// ========== OVERRIDE METHODS ========== // ========== OVERRIDE METHODS ==========
// (You'll only need this when creating your own custom binary sensor) // (You'll only need this when creating your own custom binary sensor)
/// Get the default device class for this sensor, or empty string for no default. /** Override this to set the default device class.
ESPDEPRECATED("device_class() is deprecated, set property during config validation instead.", "2022.01") *
* @deprecated This method is deprecated, set the property during config validation instead. (2022.1)
*/
virtual std::string device_class(); virtual std::string device_class();
protected: protected:

View File

@ -169,7 +169,11 @@ class Cover : public EntityBase {
friend CoverCall; friend CoverCall;
virtual void control(const CoverCall &call) = 0; virtual void control(const CoverCall &call) = 0;
ESPDEPRECATED("device_class() is deprecated, set property during config validation instead.", "2022.01")
/** Override this to set the default device class.
*
* @deprecated This method is deprecated, set the property during config validation instead. (2022.1)
*/
virtual std::string device_class(); virtual std::string device_class();
optional<CoverRestoreState> restore_state_(); optional<CoverRestoreState> restore_state_();

View File

@ -150,20 +150,28 @@ class Sensor : public EntityBase {
void internal_send_state_to_frontend(float state); void internal_send_state_to_frontend(float state);
protected: protected:
/// Override this to set the default unit of measurement. /** Override this to set the default unit of measurement.
ESPDEPRECATED("unit_of_measurement() is deprecated, set property during config validation instead.", "2022.01") *
* @deprecated This method is deprecated, set the property during config validation instead. (2022.1)
*/
virtual std::string unit_of_measurement(); // NOLINT virtual std::string unit_of_measurement(); // NOLINT
/// Override this to set the default accuracy in decimals. /** Override this to set the default accuracy in decimals.
ESPDEPRECATED("accuracy_decimals() is deprecated, set property during config validation instead.", "2022.01") *
* @deprecated This method is deprecated, set the property during config validation instead. (2022.1)
*/
virtual int8_t accuracy_decimals(); // NOLINT virtual int8_t accuracy_decimals(); // NOLINT
/// Override this to set the default device class. /** Override this to set the default device class.
ESPDEPRECATED("device_class() is deprecated, set property during config validation instead.", "2022.01") *
* @deprecated This method is deprecated, set the property during config validation instead. (2022.1)
*/
virtual std::string device_class(); // NOLINT virtual std::string device_class(); // NOLINT
/// Override this to set the default state class. /** Override this to set the default state class.
ESPDEPRECATED("state_class() is deprecated, set property during config validation instead.", "2022.01") *
* @deprecated This method is deprecated, set the property during config validation instead. (2022.1)
*/
virtual StateClass state_class(); // NOLINT virtual StateClass state_class(); // NOLINT
uint32_t hash_base() override; uint32_t hash_base() override;