Skip to content

Commit

Permalink
update default reporting values to the values from converter
Browse files Browse the repository at this point in the history
  • Loading branch information
devbis committed Nov 6, 2023
1 parent f1860b0 commit ec3f46c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,18 @@ void user_init(bool isRetention)
}

/* Set default reporting configuration */
u8 reportableChange = 0x00;
u8 batteryVoltageReportableChange = 0;
u8 batteryPercentReportableChange = 0;
u16 temperatureReportableChange = 10;
u16 humidityReportableChange = 50;
bdb_defaultReportingCfg(
SENSOR_DEVICE_ENDPOINT,
HA_PROFILE_ID,
ZCL_CLUSTER_GEN_POWER_CFG,
ZCL_ATTRID_BATTERY_VOLTAGE,
60,
3600,
(u8 *)&reportableChange
(u8 *)&batteryVoltageReportableChange
);
bdb_defaultReportingCfg(
SENSOR_DEVICE_ENDPOINT,
Expand All @@ -423,25 +426,25 @@ void user_init(bool isRetention)
ZCL_ATTRID_BATTERY_PERCENTAGE_REMAINING,
60,
3600,
(u8 *)&reportableChange
(u8 *)&batteryPercentReportableChange
);
bdb_defaultReportingCfg(
SENSOR_DEVICE_ENDPOINT,
HA_PROFILE_ID,
ZCL_CLUSTER_MS_TEMPERATURE_MEASUREMENT,
ZCL_TEMPERATURE_MEASUREMENT_ATTRID_MEASUREDVALUE,
10,
0x003c,
(u8 *)&reportableChange
300,
(u8 *)&temperatureReportableChange
);
bdb_defaultReportingCfg(
SENSOR_DEVICE_ENDPOINT,
HA_PROFILE_ID,
ZCL_CLUSTER_MS_RELATIVE_HUMIDITY,
ZCL_RELATIVE_HUMIDITY_ATTRID_MEASUREDVALUE,
10,
0x003c,
(u8 *)&reportableChange
300,
(u8 *)&humidityReportableChange
);

/* Initialize BDB */
Expand Down

0 comments on commit ec3f46c

Please sign in to comment.