mirror of https://github.com/arendst/Tasmota.git
Zigbee move synonyms to a specific method
This commit is contained in:
parent
2119621eb9
commit
68b11e0168
tasmota/tasmota_xdrv_driver
|
@ -173,6 +173,7 @@ public:
|
|||
void parseReportAttributes(Z_attribute_list& attr_list);
|
||||
void generateSyntheticAttributes(Z_attribute_list& attr_list);
|
||||
void removeInvalidAttributes(Z_attribute_list& attr_list);
|
||||
void applySynonymAttributes(Z_attribute_list& attr_list);
|
||||
void computeSyntheticAttributes(Z_attribute_list& attr_list);
|
||||
void generateCallBacks(Z_attribute_list& attr_list);
|
||||
void parseReadAttributes(uint16_t shortaddr, Z_attribute_list& attr_list);
|
||||
|
@ -700,11 +701,11 @@ void ZCLFrame::removeInvalidAttributes(Z_attribute_list& attr_list) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Compute new attributes based on the standard set
|
||||
// Note: both function are now split to compute on extracted attributes
|
||||
// Apply synonyms from the plug-in synonym definitions
|
||||
//
|
||||
void ZCLFrame::computeSyntheticAttributes(Z_attribute_list& attr_list) {
|
||||
void ZCLFrame::applySynonymAttributes(Z_attribute_list& attr_list) {
|
||||
Z_Device & device = zigbee_devices.findShortAddr(shortaddr);
|
||||
|
||||
String modelId((char*) device.modelId);
|
||||
|
@ -732,6 +733,20 @@ void ZCLFrame::computeSyntheticAttributes(Z_attribute_list& attr_list) {
|
|||
attr.setFloat(fval);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Compute new attributes based on the standard set
|
||||
// Note: both function are now split to compute on extracted attributes
|
||||
//
|
||||
void ZCLFrame::computeSyntheticAttributes(Z_attribute_list& attr_list) {
|
||||
Z_Device & device = zigbee_devices.findShortAddr(shortaddr);
|
||||
|
||||
String modelId((char*) device.modelId);
|
||||
// scan through attributes and apply specific converters
|
||||
for (auto &attr : attr_list) {
|
||||
if (attr.key_is_str) { continue; } // pass if key is a name
|
||||
|
||||
uint32_t ccccaaaa = (attr.cluster << 16) | attr.attr_id;
|
||||
|
||||
|
|
|
@ -1763,6 +1763,7 @@ void Z_IncomingMessage(class ZCLFrame &zcl_received) {
|
|||
|
||||
zcl_received.generateSyntheticAttributes(attr_list);
|
||||
zcl_received.removeInvalidAttributes(attr_list);
|
||||
zcl_received.applySynonymAttributes(attr_list);
|
||||
zcl_received.computeSyntheticAttributes(attr_list);
|
||||
zcl_received.generateCallBacks(attr_list); // set deferred callbacks, ex: Occupancy
|
||||
Z_postProcessAttributes(srcaddr, zcl_received.getSrcEndpoint(), attr_list);
|
||||
|
|
Loading…
Reference in New Issue