Berry add tasmota.locale() (#17843)

This commit is contained in:
s-hadinger 2023-01-31 23:23:36 +01:00 committed by GitHub
parent bd07b05d40
commit 5ea9a95660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -35,6 +35,7 @@ extern int l_scaleuint(bvm *vm);
extern int l_logInfo(bvm *vm); extern int l_logInfo(bvm *vm);
extern int l_save(bvm *vm); extern int l_save(bvm *vm);
extern int t_random_byte(bvm *vm); extern int t_random_byte(bvm *vm);
extern int l_locale(bvm *vm);
extern int l_read_sensors(bvm *vm); extern int l_read_sensors(bvm *vm);
@ -109,6 +110,7 @@ class be_class_tasmota (scope: global, name: Tasmota) {
scale_uint, func(l_scaleuint) scale_uint, func(l_scaleuint)
log, func(l_logInfo) log, func(l_logInfo)
save, func(l_save) save, func(l_save)
locale, func(l_locale)
read_sensors, func(l_read_sensors) read_sensors, func(l_read_sensors)

View File

@ -158,7 +158,15 @@ extern "C" {
be_raise(vm, kTypeError, nullptr); be_raise(vm, kTypeError, nullptr);
} }
// Berry: tasmota.time_reached(timer:int) -> bool // Berry: tasmota.locale() -> string
//
int32_t l_locale(struct bvm *vm);
int32_t l_locale(struct bvm *vm) {
be_pushstring(vm, D_HTML_LANGUAGE);
be_return(vm);
}
// Berry: tasmota.rtc() -> map
// //
int32_t l_rtc(struct bvm *vm); int32_t l_rtc(struct bvm *vm);
int32_t l_rtc(struct bvm *vm) { int32_t l_rtc(struct bvm *vm) {