diff --git a/esphome/components/mhz19/mhz19.cpp b/esphome/components/mhz19/mhz19.cpp index 65deb26a16..3d97a9a750 100644 --- a/esphome/components/mhz19/mhz19.cpp +++ b/esphome/components/mhz19/mhz19.cpp @@ -11,7 +11,6 @@ static const uint8_t MHZ19_COMMAND_GET_PPM[] = {0xFF, 0x01, 0x86, 0x00, 0x00, 0x static const uint8_t MHZ19_COMMAND_ABC_ENABLE[] = {0xff, 0x01, 0x79, 0xA0, 0x00, 0x00, 0x00, 0x00}; static const uint8_t MHZ19_COMMAND_ABC_DISABLE[] = {0xff, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00}; static const uint8_t MHZ19_COMMAND_CALIBRATE_ZERO[] = {0xff, 0x01, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00}; -static const uint8_t MHZ19_COMMAND_CALIBRATE_SPAN[] = {0xff, 0x01, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00}; uint8_t mhz19_checksum(const uint8_t *command) { uint8_t sum = 0; @@ -67,11 +66,6 @@ void MHZ19Component::calibrate_zero() { this->mhz19_write_command_(MHZ19_COMMAND_CALIBRATE_ZERO, nullptr); } -void MHZ19Component::calibrate_span() { - ESP_LOGI(TAG, "MHZ19 Calibrating span point"); - this->mhz19_write_command_(MHZ19_COMMAND_CALIBRATE_SPAN, nullptr); -} - void MHZ19Component::abc_enable() { ESP_LOGI(TAG, "MHZ19 Enabling ABC"); this->mhz19_write_command_(MHZ19_COMMAND_ABC_ENABLE, nullptr); diff --git a/esphome/components/mhz19/mhz19.h b/esphome/components/mhz19/mhz19.h index 17350691aa..9ee18fa418 100644 --- a/esphome/components/mhz19/mhz19.h +++ b/esphome/components/mhz19/mhz19.h @@ -23,7 +23,6 @@ class MHZ19Component : public PollingComponent, public uart::UARTDevice { void dump_config() override; void calibrate_zero(); - void calibrate_span(); void abc_enable(); void abc_disable(); @@ -48,15 +47,6 @@ template class MHZ19CalibrateZeroAction : public Action { MHZ19Component *mhz19_; }; -template class MHZ19CalibrateSpanAction : public Action { - public: - MHZ19CalibrateSpanAction(MHZ19Component *mhz19) : mhz19_(mhz19) {} - void play(Ts... x) override { this->mhz19_->calibrate_span(); } - - protected: - MHZ19Component *mhz19_; -}; - template class MHZ19ABCEnableAction : public Action { public: MHZ19ABCEnableAction(MHZ19Component *mhz19) : mhz19_(mhz19) {} diff --git a/esphome/components/mhz19/sensor.py b/esphome/components/mhz19/sensor.py index 325e326fa0..e3b87bf7aa 100644 --- a/esphome/components/mhz19/sensor.py +++ b/esphome/components/mhz19/sensor.py @@ -13,7 +13,6 @@ CONF_AUTOMATIC_BASELINE_CALIBRATION = 'automatic_baseline_calibration' mhz19_ns = cg.esphome_ns.namespace('mhz19') MHZ19Component = mhz19_ns.class_('MHZ19Component', cg.PollingComponent, uart.UARTDevice) MHZ19CalibrateZeroAction = mhz19_ns.class_('MHZ19CalibrateZeroAction', automation.Action) -MHZ19CalibrateSpanAction = mhz19_ns.class_('MHZ19CalibrateSpanAction', automation.Action) MHZ19ABCEnableAction = mhz19_ns.class_('MHZ19ABCEnableAction', automation.Action) MHZ19ABCDisableAction = mhz19_ns.class_('MHZ19ABCDisableAction', automation.Action) @@ -48,7 +47,6 @@ CALIBRATION_ACTION_SCHEMA = maybe_simple_id({ @automation.register_action('mhz19.calibrate_zero', MHZ19CalibrateZeroAction, CALIBRATION_ACTION_SCHEMA) -@automation.register_action('mhz19.calibrate_span', MHZ19CalibrateSpanAction, CALIBRATION_ACTION_SCHEMA) @automation.register_action('mhz19.abc_enable', MHZ19ABCEnableAction, CALIBRATION_ACTION_SCHEMA) @automation.register_action('mhz19.abc_disable', MHZ19ABCDisableAction, CALIBRATION_ACTION_SCHEMA) def mhz19_calibration_to_code(config, action_id, template_arg, args):