diff --git a/components/cn105/uptime_connection_sensor.cpp b/components/cn105/uptime_connection_sensor.cpp index fa22a26..7f5e509 100644 --- a/components/cn105/uptime_connection_sensor.cpp +++ b/components/cn105/uptime_connection_sensor.cpp @@ -9,7 +9,7 @@ namespace esphome { static const char* const TAG = "uptime.connection.sensor"; void HpUpTimeConnectionSensor::update() { if (connected_) { - UptimeSensor::update(); + UptimeSecondsSensor::update(); } else { this->uptime_ = 0; this->publish_state(0); @@ -31,4 +31,4 @@ namespace esphome { void HpUpTimeConnectionSensor::dump_config() { LOG_SENSOR("", "Uptime Connection Sensor", this); } } // namespace uptime -} // namespace esphome \ No newline at end of file +} // namespace esphome diff --git a/components/cn105/uptime_connection_sensor.h b/components/cn105/uptime_connection_sensor.h index 9314a32..97c2977 100644 --- a/components/cn105/uptime_connection_sensor.h +++ b/components/cn105/uptime_connection_sensor.h @@ -1,10 +1,10 @@ #pragma once -#include "esphome/components/uptime/uptime_sensor.h" +#include "esphome/components/uptime/uptime_seconds_sensor.h" namespace esphome { namespace uptime { - class HpUpTimeConnectionSensor : public UptimeSensor { + class HpUpTimeConnectionSensor : public UptimeSecondsSensor { public: void update() override; std::string unique_id() override; @@ -16,4 +16,4 @@ namespace esphome { bool connected_{ false }; }; } // namespace uptime -} // namespace esphome \ No newline at end of file +} // namespace esphome