Tasmota/lib/libesp32/Berry/default/be_energylib.c

29 lines
655 B
C
Raw Normal View History

2021-03-13 21:42:24 +00:00
/********************************************************************
* Tasmota lib
*
* To use: `import power`
*
* read power values
*******************************************************************/
2021-04-28 18:30:19 +01:00
#include "be_constobj.h"
2021-03-13 21:42:24 +00:00
2021-04-24 11:11:06 +01:00
#ifdef USE_ENERGY_SENSOR
2021-03-13 21:42:24 +00:00
extern int b_nrg_read(bvm *vm);
2021-04-28 18:30:19 +01:00
#if !BE_USE_PRECOMPILED_OBJECT
2021-03-13 21:42:24 +00:00
be_native_module_attr_table(energy) {
be_native_module_function("read", b_nrg_read),
};
be_define_native_module(energy, NULL);
#else
/* @const_object_info_begin
2021-04-28 18:30:19 +01:00
module energy (scope: global) {
read, func(b_nrg_read)
2021-03-13 21:42:24 +00:00
}
@const_object_info_end */
2021-04-28 18:30:19 +01:00
#include "../generate/be_fixed_energy.h"
2021-03-13 21:42:24 +00:00
#endif
2021-04-24 11:11:06 +01:00
#endif // USE_ENERGY_SENSOR