Merge pull request #13868 from s-hadinger/berry_devices_present

Berry add `tasmota.global.devices_present`
This commit is contained in:
s-hadinger 2021-11-30 08:29:46 +01:00 committed by GitHub
commit 03606b9267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -33,9 +33,10 @@ extern "C" {
extern const be_ctypes_structure_t be_tasmota_global_struct = {
sizeof(TasmotaGlobal), /* size in bytes */
1, /* number of elements */
2, /* number of elements */
nullptr,
(const be_ctypes_structure_item_t[2]) {
{ "devices_present", offsetof(TasmotaGlobal_t, devices_present), 0, 0, ctypes_u8, 0 },
{ "sleep", offsetof(TasmotaGlobal_t, sleep), 0, 0, ctypes_u8, 0 },
}};
@ -43,7 +44,7 @@ extern "C" {
sizeof(TSettings), /* size in bytes */
1, /* number of elements */
nullptr,
(const be_ctypes_structure_item_t[2]) {
(const be_ctypes_structure_item_t[1]) {
{ "sleep", offsetof(TSettings, sleep), 0, 0, ctypes_u8, 0 },
}};

View File

@ -811,8 +811,9 @@ bool Xdrv52(uint8_t function)
case FUNC_EVERY_SECOND:
callBerryEventDispatcher(PSTR("every_second"), nullptr, 0, nullptr);
break;
// case FUNC_SET_POWER:
// break;
case FUNC_SET_POWER:
callBerryEventDispatcher(PSTR("set_power_handler"), nullptr, XdrvMailbox.index, nullptr);
break;
#ifdef USE_WEBSERVER
case FUNC_WEB_ADD_CONSOLE_BUTTON:
if (XdrvMailbox.index) {