From 429daceadd01df3d897aab26422c7b4d7d3b3fb4 Mon Sep 17 00:00:00 2001 From: Igor Novgorodov Date: Thu, 23 Jan 2025 21:38:40 +0100 Subject: [PATCH 1/2] add adc/sampling_mode doc --- components/sensor/adc.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/components/sensor/adc.rst b/components/sensor/adc.rst index 364ba80b71..1c98a60dd7 100644 --- a/components/sensor/adc.rst +++ b/components/sensor/adc.rst @@ -35,6 +35,7 @@ Configuration variables: attenuation to use. See :ref:`adc-esp32_attenuation`. Defaults to ``0db``. - **raw** (*Optional*): Allows to read the raw ADC output without any conversion or calibration. See :ref:`adc-raw`. Defaults to ``false``. - **samples** (*Optional*): The amount of ADC readings to take per sensor update. On the ESP32 this value is ignored if ``attenuation`` is set to ``auto``. Defaults to ``1``. +- **sampling_mode** (*Optional*): Sampling method to use when multiple samples are taken. Can be ``avg`` (average of all samples), ``min`` (minimal value from all samples), ``max`` (maximal value from all samples). Defaults to ``avg``. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. - All other options from :ref:`Sensor `. From 41dc44115bc1be88706f50d020b9c671a8a59a48 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:26:10 +1300 Subject: [PATCH 2/2] Update components/sensor/adc.rst --- components/sensor/adc.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/sensor/adc.rst b/components/sensor/adc.rst index 1c98a60dd7..649f8d0b81 100644 --- a/components/sensor/adc.rst +++ b/components/sensor/adc.rst @@ -35,7 +35,12 @@ Configuration variables: attenuation to use. See :ref:`adc-esp32_attenuation`. Defaults to ``0db``. - **raw** (*Optional*): Allows to read the raw ADC output without any conversion or calibration. See :ref:`adc-raw`. Defaults to ``false``. - **samples** (*Optional*): The amount of ADC readings to take per sensor update. On the ESP32 this value is ignored if ``attenuation`` is set to ``auto``. Defaults to ``1``. -- **sampling_mode** (*Optional*): Sampling method to use when multiple samples are taken. Can be ``avg`` (average of all samples), ``min`` (minimal value from all samples), ``max`` (maximal value from all samples). Defaults to ``avg``. +- **sampling_mode** (*Optional*): Sampling method to use when multiple samples are taken. + + - ``avg`` average of all samples (**Default**) + - ``min`` minimal value from all samples + - ``max`` maximal value from all samples + - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. - All other options from :ref:`Sensor `.