mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	Calibrate Beken internal temperature (#6599)
This commit is contained in:
		| @@ -55,11 +55,13 @@ void InternalTemperatureSensor::update() { | ||||
|   uint32_t raw, result; | ||||
|   result = temp_single_get_current_temperature(&raw); | ||||
|   success = (result == 0); | ||||
| #ifdef USE_LIBRETINY_VARIANT_BK7231T | ||||
| #if defined(USE_LIBRETINY_VARIANT_BK7231N) | ||||
|   temperature = raw * -0.38f + 156.0f; | ||||
| #elif defined(USE_LIBRETINY_VARIANT_BK7231T) | ||||
|   temperature = raw * 0.04f; | ||||
| #else | ||||
| #else   // USE_LIBRETINY_VARIANT | ||||
|   temperature = raw * 0.128f; | ||||
| #endif  // USE_LIBRETINY_VARIANT_BK7231T | ||||
| #endif  // USE_LIBRETINY_VARIANT | ||||
| #endif  // USE_BK72XX | ||||
|   if (success && std::isfinite(temperature)) { | ||||
|     this->publish_state(temperature); | ||||
|   | ||||
							
								
								
									
										3
									
								
								tests/components/internal_temperature/test.bk72xx.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								tests/components/internal_temperature/test.bk72xx.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| sensor: | ||||
|   - platform: internal_temperature | ||||
|     name: "Internal Temperature" | ||||
| @@ -0,0 +1,3 @@ | ||||
| sensor: | ||||
|   - platform: internal_temperature | ||||
|     name: "Internal Temperature" | ||||
							
								
								
									
										3
									
								
								tests/components/internal_temperature/test.esp32-c3.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								tests/components/internal_temperature/test.esp32-c3.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| sensor: | ||||
|   - platform: internal_temperature | ||||
|     name: "Internal Temperature" | ||||
| @@ -0,0 +1,3 @@ | ||||
| sensor: | ||||
|   - platform: internal_temperature | ||||
|     name: "Internal Temperature" | ||||
							
								
								
									
										3
									
								
								tests/components/internal_temperature/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								tests/components/internal_temperature/test.esp32.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| sensor: | ||||
|   - platform: internal_temperature | ||||
|     name: "Internal Temperature" | ||||
							
								
								
									
										3
									
								
								tests/components/internal_temperature/test.rp2040.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								tests/components/internal_temperature/test.rp2040.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| sensor: | ||||
|   - platform: internal_temperature | ||||
|     name: "Internal Temperature" | ||||
		Reference in New Issue
	
	Block a user