mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 10:12:52 +00:00
Emits one PROGMEM array per distinct type and contents and returns the same variable to later callers. The array name is made unique against every config id and registered variable, so a generated table can never collide with a user id.
109 lines
2.1 KiB
Python
109 lines
2.1 KiB
Python
# Base file for all codegen-related imports
|
|
# All integrations should have a line in the import section like this
|
|
#
|
|
# >>> import esphome.codegen as cg
|
|
#
|
|
# Integrations should specifically *NOT* import directly from the
|
|
# other helper modules (cpp_generator etc) directly if they don't
|
|
# want to break suddenly due to a rename (this file will get backports for features).
|
|
|
|
# pylint: disable=unused-import
|
|
from esphome.cpp_generator import ( # noqa: F401
|
|
ArrayInitializer,
|
|
Expression,
|
|
FlashStringLiteral,
|
|
LineComment,
|
|
LogStringLiteral,
|
|
MockObj,
|
|
MockObjClass,
|
|
Pvariable,
|
|
RawExpression,
|
|
RawStatement,
|
|
Statement,
|
|
StructInitializer,
|
|
TemplateArguments,
|
|
add,
|
|
add_build_flag,
|
|
add_build_unflag,
|
|
add_cmake_arg,
|
|
add_cxx_build_flag,
|
|
add_define,
|
|
add_global,
|
|
add_library,
|
|
add_platformio_option,
|
|
get_variable,
|
|
get_variable_with_full_id,
|
|
is_template,
|
|
new_Pvariable,
|
|
new_variable,
|
|
process_lambda,
|
|
progmem_array,
|
|
safe_exp,
|
|
set_cpp_standard,
|
|
shared_progmem_array,
|
|
statement,
|
|
static_const_array,
|
|
static_function,
|
|
templatable,
|
|
variable,
|
|
with_local_variable,
|
|
)
|
|
from esphome.cpp_helpers import ( # noqa: F401
|
|
build_registry_entry,
|
|
build_registry_list,
|
|
extract_registry_entry_config,
|
|
get_slot_count,
|
|
gpio_pin_expression,
|
|
past_safe_mode,
|
|
register_component,
|
|
register_parented,
|
|
set_setup_priority,
|
|
slot_counter,
|
|
)
|
|
from esphome.cpp_types import ( # noqa: F401
|
|
NAN,
|
|
App,
|
|
Application,
|
|
Component,
|
|
ComponentPtr,
|
|
EntityBase,
|
|
EntityCategory,
|
|
ESPTime,
|
|
FixedVector,
|
|
GPIOPin,
|
|
InternalGPIOPin,
|
|
JsonObject,
|
|
JsonObjectConst,
|
|
Parented,
|
|
PollingComponent,
|
|
StringRef,
|
|
arduino_json_ns,
|
|
bool_,
|
|
char,
|
|
const_char_ptr,
|
|
double,
|
|
esphome_ns,
|
|
float_,
|
|
global_ns,
|
|
gpio_Flags,
|
|
int8,
|
|
int16,
|
|
int32,
|
|
int64,
|
|
int_,
|
|
nullptr,
|
|
optional,
|
|
size_t,
|
|
std_ns,
|
|
std_shared_ptr,
|
|
std_span,
|
|
std_string,
|
|
std_string_ref,
|
|
std_vector,
|
|
uint8,
|
|
uint16,
|
|
uint32,
|
|
uint64,
|
|
void,
|
|
)
|