mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Merge branch 'integration' into memory_api
This commit is contained in:
		| @@ -17,8 +17,8 @@ void log_sensor(const char *tag, const char *prefix, const char *type, Sensor *o | |||||||
|                 "%s  State Class: '%s'\n" |                 "%s  State Class: '%s'\n" | ||||||
|                 "%s  Unit of Measurement: '%s'\n" |                 "%s  Unit of Measurement: '%s'\n" | ||||||
|                 "%s  Accuracy Decimals: %d", |                 "%s  Accuracy Decimals: %d", | ||||||
|                 prefix, type, obj->get_name().c_str(), prefix, state_class_to_string(obj->get_state_class()).c_str(), |                 prefix, type, obj->get_name().c_str(), prefix, state_class_to_string(obj->get_state_class()), prefix, | ||||||
|                 prefix, obj->get_unit_of_measurement_ref().c_str(), prefix, obj->get_accuracy_decimals()); |                 obj->get_unit_of_measurement_ref().c_str(), prefix, obj->get_accuracy_decimals()); | ||||||
|  |  | ||||||
|   if (!obj->get_device_class_ref().empty()) { |   if (!obj->get_device_class_ref().empty()) { | ||||||
|     ESP_LOGCONFIG(tag, "%s  Device Class: '%s'", prefix, obj->get_device_class_ref().c_str()); |     ESP_LOGCONFIG(tag, "%s  Device Class: '%s'", prefix, obj->get_device_class_ref().c_str()); | ||||||
| @@ -33,7 +33,7 @@ void log_sensor(const char *tag, const char *prefix, const char *type, Sensor *o | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| std::string state_class_to_string(StateClass state_class) { | const char *state_class_to_string(StateClass state_class) { | ||||||
|   switch (state_class) { |   switch (state_class) { | ||||||
|     case STATE_CLASS_MEASUREMENT: |     case STATE_CLASS_MEASUREMENT: | ||||||
|       return "measurement"; |       return "measurement"; | ||||||
|   | |||||||
| @@ -33,7 +33,7 @@ enum StateClass : uint8_t { | |||||||
|   STATE_CLASS_TOTAL = 3, |   STATE_CLASS_TOTAL = 3, | ||||||
| }; | }; | ||||||
|  |  | ||||||
| std::string state_class_to_string(StateClass state_class); | const char *state_class_to_string(StateClass state_class); | ||||||
|  |  | ||||||
| /** Base-class for all sensors. | /** Base-class for all sensors. | ||||||
|  * |  * | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user