mirror of https://github.com/arendst/Tasmota.git
Zigbee added for attributes of type `uint48` used by energy monitoring (#20992)
This commit is contained in:
parent
e644ed0724
commit
9c34707401
|
@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
## [13.4.0.3]
|
||||
### Added
|
||||
|
||||
- Zigbee added for attributes of type `uint48` used by energy monitoring
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
|
|
|
@ -331,6 +331,14 @@ int32_t encodeSingleAttribute(SBuffer &buf, double val_d, const char *val_str, u
|
|||
buf.add32( *((uint32_t*)&f32) ); // cast float as uint32_t
|
||||
break;
|
||||
|
||||
case Zuint48: // added for energy value
|
||||
{
|
||||
uint64_t u64 = val_d;
|
||||
buf.add32(u64);
|
||||
buf.add8(u64 >> 32);
|
||||
}
|
||||
break;
|
||||
|
||||
case Zstring:
|
||||
case Zstring16:
|
||||
{
|
||||
|
|
|
@ -459,7 +459,7 @@ void ZbSendReportWrite(class JsonParserToken val_pubwrite, class ZCLFrame & zcl)
|
|||
if (!attr_discrete) {
|
||||
int32_t res = encodeSingleAttribute(buf, val_d, val_str, attr.attr_type);
|
||||
if (res < 0) {
|
||||
Response_P(PSTR("{\"%s\":\"%s'%s' 0x%02X\"}"), XdrvMailbox.command, PSTR(D_ZIGBEE_UNSUPPORTED_ATTRIBUTE_TYPE " "), key, attr.attr_type);
|
||||
Response_P(PSTR("{\"%s\":\"%s'%s' 0x%02X\"}"), XdrvMailbox.command, PSTR(D_ZIGBEE_UNSUPPORTED_ATTRIBUTE_TYPE " "), key.getStr(), attr.attr_type);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue