Files
esphome/tests/components/mics_5524/common.h
T
eafcca8274 [mics_5524] Add datasheet model, diagnostics and advanced wiring (2/2) (#20521)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-10-16 22:47:28 -10:00

28 lines
922 B
C++

#pragma once
#include <gtest/gtest.h>
#include <cmath>
#include "esphome/components/mics_5524/mics_math.h"
namespace esphome::mics_5524::testing {
using micsmath::air_value_from_voltage;
using micsmath::calibration_is_stable;
using micsmath::clamp_ppm;
using micsmath::ppm_from_power_law;
using micsmath::ppm_from_vendor_curve;
using micsmath::ratio_from_air_value;
using micsmath::ratio_from_rs;
using micsmath::rs_from_voltage;
// Independent copy of the DFRobot table; the Python tests pin coefficients.py itself.
constexpr micsmath::VendorCurve CO{0.425f, 0.000405f, 1.0f, 1000.0f};
constexpr micsmath::VendorCurve H2{0.279f, 0.00026f, 1.0f, 1000.0f};
constexpr micsmath::VendorCurve NH3{0.8f, 0.0015f, 10.0f, 500.0f};
constexpr micsmath::VendorCurve C2H5OH{0.306f, 0.00057f, 10.0f, 500.0f};
constexpr micsmath::VendorCurve CH4{0.786f, 0.000023f, 1000.0f, 25000.0f};
} // namespace esphome::mics_5524::testing