i tried following:
#
#
# Globals zur übergreifenden Verwendung in allen LAMBDAs
# --------------------------------------------------------
globals:
# ------------
# interne variablen ->
# ------------
- id: my_global_array
type: int[6]
initial_value: '{1, 2, 13, 4, 15, 77}'
text_sensor:
- platform: template
name: outputstring
id: string_output
lambda: |-
int ii ;
ii = id(my_global_array).size ;
return {"Hello World"};
#
result in HA should be : 6 as int
but a compiling error like this
/config/esphome/wemos-01.yaml: In lambda function:
/config/esphome/wemos-01.yaml:87:37: error: request for member 'size' in 'my_global_array->esphome::globals::GlobalsComponent<int [6]>::value()', which is of non-class type 'int [6]'
87 | ii = id(my_global_array).size ;
| ^
*** [.pioenvs/wemos-01/src/main.cpp.o] Error 1
lambda: |-
int ii ;
ii = id(my_global_array).size() ;
return {"Hello World"};
#
#
brackets after size gave the same error…