2#if defined(USE_ZIGBEE) && defined(USE_NRF52) && defined(USE_SENSOR)
6#include <zboss_api_addons.h>
7#include <zb_nrf_platform.h>
8#include <zigbee/zigbee_app_utils.h>
9#include <zb_error_to_string.h>
13static const char *
const TAG =
"zigbee.sensor";
20 ESP_LOGD(TAG,
"Set attribute endpoint: %d, present_value %f", this->
endpoint_, state);
21 ZB_ZCL_SET_ATTRIBUTE(this->
endpoint_, ZB_ZCL_CLUSTER_ID_ANALOG_INPUT, ZB_ZCL_CLUSTER_SERVER_ROLE,
31 " Endpoint: %d, present_value %f",
37static zb_ret_t check_value_analog_server(zb_uint16_t attr_id, zb_uint8_t endpoint,
39 zb_ret_t ret = RET_OK;
44 ret = ZB_ZCL_CHECK_BOOL_VALUE(*value) ? RET_OK : RET_ERROR;
65 zb_zcl_add_cluster_handlers(ZB_ZCL_CLUSTER_ID_ANALOG_INPUT, ZB_ZCL_CLUSTER_SERVER_ROLE,
66 esphome::zigbee::check_value_analog_server, (zb_zcl_cluster_write_attr_hook_t) NULL,
67 (zb_zcl_cluster_handler_t) NULL);
71 zb_zcl_add_cluster_handlers(ZB_ZCL_CLUSTER_ID_ANALOG_INPUT, ZB_ZCL_CLUSTER_CLIENT_ROLE,
72 (zb_zcl_cluster_check_value_t) NULL, (zb_zcl_cluster_write_attr_hook_t) NULL,
73 (zb_zcl_cluster_handler_t) NULL);
Base-class for all sensors.
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.
ZigbeeComponent * parent_
ZigbeeSensor(sensor::Sensor *sensor)
AnalogAttrs * cluster_attributes_
void dump_config() override
const zb_uint8_t ZB_ZCL_ANALOG_INPUT_STATUS_FLAG_MAX_VALUE
void zb_zcl_analog_input_init_client()
void zb_zcl_analog_input_init_server()
@ ZB_ZCL_ATTR_ANALOG_INPUT_PRESENT_VALUE_ID
@ ZB_ZCL_ATTR_ANALOG_INPUT_OUT_OF_SERVICE_ID
@ ZB_ZCL_ATTR_ANALOG_INPUT_STATUS_FLAG_ID