mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	change name ESPHOME_EMPTY -> NONE
This commit is contained in:
		| @@ -24,7 +24,7 @@ template<int... S> struct gens<0, S...> { using type = seq<S...>; };  // NOLINT | ||||
|  | ||||
| template<typename T, typename... X> class TemplatableValue { | ||||
|  public: | ||||
|   TemplatableValue() : type_(ESPHOME_EMPTY) {} | ||||
|   TemplatableValue() : type_(NONE) {} | ||||
|  | ||||
|   template<typename F, enable_if_t<!is_invocable<F, X...>::value, int> = 0> | ||||
|   TemplatableValue(F value) : type_(VALUE), value_(value) {} | ||||
| @@ -32,13 +32,13 @@ template<typename T, typename... X> class TemplatableValue { | ||||
|   template<typename F, enable_if_t<is_invocable<F, X...>::value, int> = 0> | ||||
|   TemplatableValue(F f) : type_(LAMBDA), f_(f) {} | ||||
|  | ||||
|   bool has_value() { return this->type_ != ESPHOME_EMPTY; } | ||||
|   bool has_value() { return this->type_ != NONE; } | ||||
|  | ||||
|   T value(X... x) { | ||||
|     if (this->type_ == LAMBDA) { | ||||
|       return this->f_(x...); | ||||
|     } | ||||
|     // return value also when empty | ||||
|     // return value also when none | ||||
|     return this->value_; | ||||
|   } | ||||
|  | ||||
| @@ -58,7 +58,7 @@ template<typename T, typename... X> class TemplatableValue { | ||||
|  | ||||
|  protected: | ||||
|   enum { | ||||
|     ESPHOME_EMPTY, | ||||
|     NONE, | ||||
|     VALUE, | ||||
|     LAMBDA, | ||||
|   } type_; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user