10 static const char *
const TAG =
"ds1307";
13 ESP_LOGCONFIG(TAG,
"Setting up DS1307...");
22 ESP_LOGCONFIG(TAG,
"DS1307:");
25 ESP_LOGE(TAG,
"Communication with DS1307 failed!");
27 ESP_LOGCONFIG(TAG,
" Timezone: '%s'", this->
timezone_.c_str());
37 ESP_LOGW(TAG,
"RTC halted, not syncing to system clock.");
52 rtc_time.recalc_timestamp_utc(
false);
53 if (!rtc_time.is_valid()) {
54 ESP_LOGE(TAG,
"Invalid RTC time, not syncing to system clock.");
63 ESP_LOGE(TAG,
"Invalid system time, not syncing to RTC.");
86 ESP_LOGE(TAG,
"Can't read I2C data.");
89 ESP_LOGD(TAG,
"Read %0u%0u:%0u%0u:%0u%0u 20%0u%0u-%0u%0u-%0u%0u CH:%s RS:%0u SQWE:%s OUT:%s",
ds1307_.
reg.
hour_10,
99 ESP_LOGE(TAG,
"Can't write I2C data.");
102 ESP_LOGD(TAG,
"Write %0u%0u:%0u%0u:%0u%0u 20%0u%0u-%0u%0u-%0u%0u CH:%s RS:%0u SQWE:%s OUT:%s",
ds1307_.
reg.
hour_10,
ESPTime now()
Get the time in the currently defined timezone.
const float DATA
For components that import data from directly connected sensors like DHT.
A more user-friendly version of struct tm from time.h.
bool read_bytes(uint8_t a_register, uint8_t *data, uint8_t len)
Compat APIs All methods below have been added for compatibility reasons.
void dump_config() override
struct esphome::ds1307::DS1307Component::DS1307Reg::@75 reg
uint8_t second
seconds after the minute [0-60]
uint8_t minute
minutes after the hour [0-59]
union esphome::ds1307::DS1307Component::DS1307Reg ds1307_
float get_setup_priority() const override
bool is_valid() const
Check if this ESPTime is valid (all fields in range and year is greater than 2018) ...
uint8_t day_of_week
day of the week; sunday=1 [1-7]
ESPTime utcnow()
Get the time without any time zone or DST corrections.
virtual void mark_failed()
Mark this component as failed.
Implementation of SPI Controller mode.
void synchronize_epoch_(uint32_t epoch)
Report a unix epoch as current time.
uint8_t month
month; january=1 [1-12]
uint8_t hour
hours since midnight [0-23]
uint8_t day_of_month
day of the month [1-31]
bool write_bytes(uint8_t a_register, const uint8_t *data, uint8_t len, bool stop=true)