diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index c2067cf..12e98c3 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -247,11 +247,11 @@ api: switch.is_on: nextion_init - lambda: |- //ESP_LOGD("nextion", "thermostat sendig value %f", value); - int v = int(2 * min(max(value - 13.5, 0.0), 5.0)); + int v = int(2 * std::min(std::max(value - 13.5, 0.0), 5.0)); int left = v + (v ? 19 : 16); // 16 is empty left. - v = int(2 * min(max(value - 18.0, 0), 4.0)); + v = int(2 * std::min(std::max(value - 18.0, 0.0), 4.0)); int mid = v + (v ? 29 : 17); // 17 is empty mid. - v = int(2 * min(max(value - 21.5, 0), 5.5)); + v = int(2 * std::min(std::max(value - 21.5, 0.0), 5.5)); int right = v + (v ? 37 : 18); // 18 is empty right. // sends the 3 images to the display //ESP_LOGD("nextion", "thermostat left %i", left); @@ -391,21 +391,21 @@ sensor: name: ${device_name} RSSI update_interval: 60s - ##### INTERNAL TEMPERATUE SENSOR, ADC VALUE ##### + ##### INTERNAL TEMPERATURE SENSOR, ADC VALUE ##### - platform: adc id: ntc_source pin: 38 update_interval: 10s attenuation: 11db - ##### INTERNAL TEMPERATUE SENSOR, adc reading converted to resistance (calculation)##### + ##### INTERNAL TEMPERATURE SENSOR, adc reading converted to resistance (calculation)##### - platform: resistance id: resistance_sensor sensor: ntc_source configuration: DOWNSTREAM resistor: 11.2kOhm - ##### INTERNAL TEMPERATUE SENSOR, resistance to temperature (calculation) ##### + ##### INTERNAL TEMPERATURE SENSOR, resistance to temperature (calculation) ##### - platform: ntc name: ${device_name} Temperature id: temp_nspanel