ESPHome
2026.3.0-dev
Loading...
Searching...
No Matches
esphome
components
zigbee
time
zigbee_time_zephyr.h
Go to the documentation of this file.
1
#pragma once
2
#include "
esphome/core/defines.h
"
3
#if defined(USE_ZIGBEE) && defined(USE_NRF52) && defined(USE_TIME)
4
#include "
esphome/core/component.h
"
5
#include "
esphome/components/time/real_time_clock.h
"
6
#include "
esphome/components/zigbee/zigbee_zephyr.h
"
7
8
extern
"C"
{
9
#include <zboss_api.h>
10
#include <zboss_api_addons.h>
11
}
12
13
namespace
esphome::zigbee
{
14
15
class
ZigbeeTime
:
public
time::RealTimeClock
,
public
ZigbeeEntity
{
16
public
:
17
void
setup
()
override
;
18
void
dump_config
()
override
;
19
void
update
()
override
;
20
21
void
set_cluster_attributes
(zb_zcl_time_attrs_t &cluster_attributes) {
22
this->
cluster_attributes_
= &cluster_attributes;
23
}
24
25
void
set_epoch_time
(uint32_t epoch);
26
27
protected
:
28
static
void
sync_time
(zb_ret_t status, zb_uint32_t auth_level, zb_uint16_t short_addr, zb_uint8_t endpoint,
29
zb_uint32_t nw_time);
30
void
zcl_device_cb_
(zb_bufid_t bufid);
31
zb_zcl_time_attrs_t *
cluster_attributes_
{
nullptr
};
32
33
bool
has_time_
{
false
};
34
};
35
36
}
// namespace esphome::zigbee
37
38
#endif
esphome::time::RealTimeClock
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
Definition
real_time_clock.h:18
esphome::zigbee::ZigbeeEntity
Definition
zigbee_zephyr.h:99
esphome::zigbee::ZigbeeTime
Definition
zigbee_time_zephyr.h:15
esphome::zigbee::ZigbeeTime::setup
void setup() override
Definition
zigbee_time_zephyr.cpp:25
esphome::zigbee::ZigbeeTime::set_epoch_time
void set_epoch_time(uint32_t epoch)
Definition
zigbee_time_zephyr.cpp:45
esphome::zigbee::ZigbeeTime::has_time_
bool has_time_
Definition
zigbee_time_zephyr.h:33
esphome::zigbee::ZigbeeTime::sync_time
static void sync_time(zb_ret_t status, zb_uint32_t auth_level, zb_uint16_t short_addr, zb_uint8_t endpoint, zb_uint32_t nw_time)
Definition
zigbee_time_zephyr.cpp:15
esphome::zigbee::ZigbeeTime::dump_config
void dump_config() override
Definition
zigbee_time_zephyr.cpp:32
esphome::zigbee::ZigbeeTime::zcl_device_cb_
void zcl_device_cb_(zb_bufid_t bufid)
Definition
zigbee_time_zephyr.cpp:52
esphome::zigbee::ZigbeeTime::set_cluster_attributes
void set_cluster_attributes(zb_zcl_time_attrs_t &cluster_attributes)
Definition
zigbee_time_zephyr.h:21
esphome::zigbee::ZigbeeTime::cluster_attributes_
zb_zcl_time_attrs_t * cluster_attributes_
Definition
zigbee_time_zephyr.h:31
esphome::zigbee::ZigbeeTime::update
void update() override
Definition
zigbee_time_zephyr.cpp:40
component.h
defines.h
esphome::zigbee
Definition
automation.h:7
real_time_clock.h
zigbee_zephyr.h
Generated by
1.12.0