mirror of https://github.com/arendst/Tasmota.git
Berry add `energy.update_total()` to call `EnergyUpdateTotal()` from energy driver (#19117)
This commit is contained in:
parent
ebca2f0a07
commit
ada754c582
|
@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
|
|||
- Partition Wizard is now able to convert to safeboot from Shelly partition layout (#19034)
|
||||
- Matter mini-profiler (#19075)
|
||||
- Berry `_class` can be used in `static var` initialization code (#19088)
|
||||
- Berry add `energy.update_total()` to call `EnergyUpdateTotal()` from energy driver
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#ifdef USE_ENERGY_SENSOR
|
||||
|
||||
extern struct ENERGY Energy;
|
||||
extern int energy_update_total(bvm *vm);
|
||||
|
||||
#include "solidify/solidified_energy.h"
|
||||
#include "be_fixed_energy.h"
|
||||
|
@ -24,6 +25,8 @@ module energy (scope: global) {
|
|||
read, closure(energy_read_closure)
|
||||
member, closure(energy_member_closure)
|
||||
setmember, closure(energy_setmember_closure)
|
||||
|
||||
update_total, func(energy_update_total)
|
||||
}
|
||||
|
||||
@const_object_info_end */
|
||||
|
|
|
@ -31,6 +31,15 @@
|
|||
*
|
||||
\*********************************************************************************************/
|
||||
extern "C" {
|
||||
|
||||
int32_t energy_update_total(struct bvm *vm);
|
||||
int32_t energy_update_total(struct bvm *vm) {
|
||||
EnergyUpdateTotal();
|
||||
be_return_nil(vm);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Winvalid-offsetof" // avoid warnings since we're using offsetof() in a risky way
|
||||
|
||||
|
|
Loading…
Reference in New Issue