From 409c9888dda6f59a02c24fa6ebb93cf9a75bd921 Mon Sep 17 00:00:00 2001 From: sfromis <47082390+sfromis@users.noreply.github.com> Date: Sun, 9 Oct 2022 16:09:29 +0200 Subject: [PATCH] Epoch in Berry map for time Uses mktime to calculate the epoch value from the broken-down time structure, could potentially be tuned if deemed too inefficient in case of the caller already having the epoch value nearby. --- tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino index a90a25916..31206442d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino @@ -265,6 +265,7 @@ extern "C" { be_map_insert_int(vm, "min", t->tm_min); be_map_insert_int(vm, "sec", t->tm_sec); be_map_insert_int(vm, "weekday", t->tm_wday); + be_map_insert_int(vm, "epoch", mktime(t)); if (unparsed) be_map_insert_str(vm, "unparsed", unparsed); be_pop(vm, 1); }