mirror of
https://github.com/esphome/esphome.git
synced 2026-05-31 17:06:40 +08:00
[time] Convert to C++17 nested namespace syntax (#12463)
This commit is contained in:
@@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::time {
|
||||||
namespace time {
|
|
||||||
|
|
||||||
static const char *const TAG = "automation";
|
static const char *const TAG = "automation";
|
||||||
static const int MAX_TIMESTAMP_DRIFT = 900; // how far can the clock drift before we consider
|
static const int MAX_TIMESTAMP_DRIFT = 900; // how far can the clock drift before we consider
|
||||||
@@ -92,5 +91,4 @@ SyncTrigger::SyncTrigger(RealTimeClock *rtc) : rtc_(rtc) {
|
|||||||
rtc->add_on_time_sync_callback([this]() { this->trigger(); });
|
rtc->add_on_time_sync_callback([this]() { this->trigger(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace time
|
} // namespace esphome::time
|
||||||
} // namespace esphome
|
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::time {
|
||||||
namespace time {
|
|
||||||
|
|
||||||
class CronTrigger : public Trigger<>, public Component {
|
class CronTrigger : public Trigger<>, public Component {
|
||||||
public:
|
public:
|
||||||
@@ -48,5 +47,4 @@ class SyncTrigger : public Trigger<>, public Component {
|
|||||||
protected:
|
protected:
|
||||||
RealTimeClock *rtc_;
|
RealTimeClock *rtc_;
|
||||||
};
|
};
|
||||||
} // namespace time
|
} // namespace esphome::time
|
||||||
} // namespace esphome
|
|
||||||
|
|||||||
@@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::time {
|
||||||
namespace time {
|
|
||||||
|
|
||||||
static const char *const TAG = "time";
|
static const char *const TAG = "time";
|
||||||
|
|
||||||
@@ -78,5 +77,4 @@ void RealTimeClock::apply_timezone_() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace time
|
} // namespace esphome::time
|
||||||
} // namespace esphome
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
#include "esphome/core/time.h"
|
#include "esphome/core/time.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome::time {
|
||||||
namespace time {
|
|
||||||
|
|
||||||
/// The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
|
/// The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
|
||||||
///
|
///
|
||||||
@@ -75,5 +74,4 @@ template<typename... Ts> class TimeHasTimeCondition : public Condition<Ts...> {
|
|||||||
RealTimeClock *parent_;
|
RealTimeClock *parent_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace time
|
} // namespace esphome::time
|
||||||
} // namespace esphome
|
|
||||||
|
|||||||
Reference in New Issue
Block a user