Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Berry Zigbee removed test code #22263

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
- ESP32 Ethernet using EthClockMode 3 (#22248)

### Removed
- Berry Zigbee removed test code

## [14.2.0.5] 20240926
### Added
Expand Down
4 changes: 2 additions & 2 deletions lib/libesp32/berry_tasmota/src/be_zigbee.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ class be_class_zb_coord_ntv (scope: global, name: zb_coord_ntv, strings: weak) {

abort, ctype_func(zc_abort)

test_attr, func(zigbee_test_attr)
test_msg, func(zigbee_test_msg)
// test_attr, func(zigbee_test_attr)
// test_msg, func(zigbee_test_msg)
}
@const_object_info_end */

Expand Down
84 changes: 42 additions & 42 deletions tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_zigbee.ino
Original file line number Diff line number Diff line change
Expand Up @@ -601,38 +601,38 @@ extern "C" {
}

extern "C" {
int zigbee_test_attr(struct bvm *vm) {
int32_t mode = be_toint(vm, 2);
if (mode < 10) {
//
} else {
Z_attribute *a = new Z_attribute();
if (mode == 10) {
a->setKeyId(1111, 2222);
a->setUInt(1337);
} else if (mode == 11) {
a->setKeyName("super_attribute");
a->key_suffix = 2;
a->setFloat(3.14);
} else if (mode == 12) {
a->setKeyName("array");
a->newJsonArray();
a->val.arrval->add((int32_t)-1);
a->val.arrval->addStr("foo");
a->val.arrval->addStr("bar");
a->val.arrval->addStr("bar\"baz\'toto");
} else if (mode == 13) {
a->setKeyName("list");
a->newAttrList();
Z_attribute &subattr1 = a->val.objval->addAttribute(10,20);
subattr1.setStr("sub1");
Z_attribute &subattr2 = a->val.objval->addAttribute(11,21);
subattr2.setStr("sub2");
}
zat_zcl_attribute(vm, a);
}
be_return(vm);
}
// int zigbee_test_attr(struct bvm *vm) {
// int32_t mode = be_toint(vm, 2);
// if (mode < 10) {
// //
// } else {
// Z_attribute *a = new Z_attribute();
// if (mode == 10) {
// a->setKeyId(1111, 2222);
// a->setUInt(1337);
// } else if (mode == 11) {
// a->setKeyName("super_attribute");
// a->key_suffix = 2;
// a->setFloat(3.14);
// } else if (mode == 12) {
// a->setKeyName("array");
// a->newJsonArray();
// a->val.arrval->add((int32_t)-1);
// a->val.arrval->addStr("foo");
// a->val.arrval->addStr("bar");
// a->val.arrval->addStr("bar\"baz\'toto");
// } else if (mode == 13) {
// a->setKeyName("list");
// a->newAttrList();
// Z_attribute &subattr1 = a->val.objval->addAttribute(10,20);
// subattr1.setStr("sub1");
// Z_attribute &subattr2 = a->val.objval->addAttribute(11,21);
// subattr2.setStr("sub2");
// }
// zat_zcl_attribute(vm, a);
// }
// be_return(vm);
// }


// Creates a zcl_attributes from Z_attribute_list
Expand All @@ -651,18 +651,18 @@ extern "C" {
}
}

int zigbee_test_msg(struct bvm *vm) {
Z_attribute_list attr_list;
// int zigbee_test_msg(struct bvm *vm) {
// Z_attribute_list attr_list;

attr_list.lqi = 250;
Z_attribute &subattr1 = attr_list.addAttribute(10,20);
subattr1.setStr("sub1");
Z_attribute &subattr2 = attr_list.addAttribute(11,21);
subattr2.setStr("sub2");
// attr_list.lqi = 250;
// Z_attribute &subattr1 = attr_list.addAttribute(10,20);
// subattr1.setStr("sub1");
// Z_attribute &subattr2 = attr_list.addAttribute(11,21);
// subattr2.setStr("sub2");

zat_zcl_attribute_list(vm, 100, &attr_list);
be_return(vm);
}
// zat_zcl_attribute_list(vm, 100, &attr_list);
// be_return(vm);
// }
}

#endif // USE_ZIGBEE
Expand Down