10 static const char *
const TAG =
"PCF8563";
13 ESP_LOGCONFIG(TAG,
"Setting up PCF8563...");
22 ESP_LOGCONFIG(TAG,
"PCF8563:");
25 ESP_LOGE(TAG,
"Communication with PCF8563 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 STOP:%s CLKOUT:%0u",
pcf8563_.
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 OSC:%s CLKOUT:%0u",
pcf8563_.
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.
struct esphome::pcf8563::PCF8563Component::PCF8563Reg::@127 reg
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.
union esphome::pcf8563::PCF8563Component::PCF8563Reg pcf8563_
float get_setup_priority() const override
uint8_t second
seconds after the minute [0-60]
uint8_t minute
minutes after the hour [0-59]
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.
void dump_config() override
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)