mirror of https://github.com/arendst/Tasmota.git
Merge pull request #8210 from s-hadinger/zigbee_esp32
Remove warning/errors when compiling Zigbee for ESP32
This commit is contained in:
commit
c6ad8ddf89
|
@ -25,15 +25,15 @@ void ZigbeeZCLSend_Raw(uint16_t dtsAddr, uint16_t groupaddr, uint16_t clusterId,
|
||||||
|
|
||||||
|
|
||||||
// Get an JSON attribute, with case insensitive key search
|
// Get an JSON attribute, with case insensitive key search
|
||||||
JsonVariant &getCaseInsensitive(const JsonObject &json, const char *needle) {
|
const JsonVariant &getCaseInsensitive(const JsonObject &json, const char *needle) {
|
||||||
// key can be in PROGMEM
|
// key can be in PROGMEM
|
||||||
if ((nullptr == &json) || (nullptr == needle) || (0 == pgm_read_byte(needle))) {
|
if ((nullptr == &json) || (nullptr == needle) || (0 == pgm_read_byte(needle))) {
|
||||||
return *(JsonVariant*)nullptr;
|
return *(JsonVariant*)nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto kv : json) {
|
for (JsonObject::const_iterator it=json.begin(); it!=json.end(); ++it) {
|
||||||
const char *key = kv.key;
|
const char *key = it->key;
|
||||||
JsonVariant &value = kv.value;
|
const JsonVariant &value = it->value;
|
||||||
|
|
||||||
if (0 == strcasecmp_P(key, needle)) {
|
if (0 == strcasecmp_P(key, needle)) {
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -201,12 +201,10 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) {
|
||||||
PSTR("{\"success\":{\"/lights/%d/state/on\":%s}}"),
|
PSTR("{\"success\":{\"/lights/%d/state/on\":%s}}"),
|
||||||
device_id, on ? "true" : "false");
|
device_id, on ? "true" : "false");
|
||||||
|
|
||||||
switch(on)
|
if (on) {
|
||||||
{
|
ZigbeeHuePower(shortaddr, 0x01);
|
||||||
case false : ZigbeeHuePower(shortaddr, 0x00);
|
} else {
|
||||||
break;
|
ZigbeeHuePower(shortaddr, 0x00);
|
||||||
case true : ZigbeeHuePower(shortaddr, 0x01);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
response += buf;
|
response += buf;
|
||||||
resp = true;
|
resp = true;
|
||||||
|
|
|
@ -109,7 +109,7 @@ public:
|
||||||
uint16_t srcaddr, uint8_t srcendpoint, uint8_t dstendpoint, uint8_t wasbroadcast,
|
uint16_t srcaddr, uint8_t srcendpoint, uint8_t dstendpoint, uint8_t wasbroadcast,
|
||||||
uint8_t linkquality, uint8_t securityuse, uint8_t seqnumber,
|
uint8_t linkquality, uint8_t securityuse, uint8_t seqnumber,
|
||||||
uint32_t timestamp):
|
uint32_t timestamp):
|
||||||
_cmd_id(cmd_id), _manuf_code(manuf_code), _transact_seq(transact_seq),
|
_manuf_code(manuf_code), _transact_seq(transact_seq), _cmd_id(cmd_id),
|
||||||
_payload(buf_len ? buf_len : 250), // allocate the data frame from source or preallocate big enough
|
_payload(buf_len ? buf_len : 250), // allocate the data frame from source or preallocate big enough
|
||||||
_cluster_id(clusterid), _groupaddr(groupaddr),
|
_cluster_id(clusterid), _groupaddr(groupaddr),
|
||||||
_srcaddr(srcaddr), _srcendpoint(srcendpoint), _dstendpoint(dstendpoint), _wasbroadcast(wasbroadcast),
|
_srcaddr(srcaddr), _srcendpoint(srcendpoint), _dstendpoint(dstendpoint), _wasbroadcast(wasbroadcast),
|
||||||
|
@ -215,9 +215,9 @@ private:
|
||||||
uint16_t _manuf_code = 0; // optional
|
uint16_t _manuf_code = 0; // optional
|
||||||
uint8_t _transact_seq = 0; // transaction sequence number
|
uint8_t _transact_seq = 0; // transaction sequence number
|
||||||
uint8_t _cmd_id = 0;
|
uint8_t _cmd_id = 0;
|
||||||
|
SBuffer _payload;
|
||||||
uint16_t _cluster_id = 0;
|
uint16_t _cluster_id = 0;
|
||||||
uint16_t _groupaddr = 0;
|
uint16_t _groupaddr = 0;
|
||||||
SBuffer _payload;
|
|
||||||
// information from decoded ZCL frame
|
// information from decoded ZCL frame
|
||||||
uint16_t _srcaddr;
|
uint16_t _srcaddr;
|
||||||
uint8_t _srcendpoint;
|
uint8_t _srcendpoint;
|
||||||
|
|
Loading…
Reference in New Issue