10 static const char *
const TAG =
"pcf85063";
13 ESP_LOGCONFIG(TAG,
"Setting up PCF85063...");
22 ESP_LOGCONFIG(TAG,
"PCF85063:");
25 ESP_LOGE(TAG,
"Communication with PCF85063 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 OSC:%s CLKOUT:%0u",
pcf85063_.
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",
pcf85063_.
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.
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.
float get_setup_priority() const override
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]
struct esphome::pcf85063::PCF85063Component::PCF85063Reg::@126 reg
uint8_t day_of_month
day of the month [1-31]
union esphome::pcf85063::PCF85063Component::PCF85063Reg pcf85063_
bool write_bytes(uint8_t a_register, const uint8_t *data, uint8_t len, bool stop=true)