Example #1
0
 def reset(self):
     self.dashboard = False
     self.name = None
     self.data = {}
     self.config_path = None
     self.build_path = None
     self.config = None
     self.event_loop = _FakeEventLoop()
     self.task_counter = 0
     self.variables = {}
     self.main_statements = []
     self.global_statements = []
     self.libraries = []
     self.build_flags = set()
     self.defines = set()
     self.platformio_options = {}
     self.loaded_integrations = set()
     self.component_ids = set()
Example #2
0
 def __init__(self):
     # True if command is run from dashboard
     self.dashboard = False
     # True if command is run from vscode api
     self.vscode = False
     self.ace = False
     # The name of the node
     self.name: Optional[str] = None
     # The relative path to the configuration YAML
     self.config_path: Optional[str] = None
     # The relative path to where all build files are stored
     self.build_path: Optional[str] = None
     # The platform (ESP8266, ESP32) of this device
     self.esp_platform: Optional[str] = None
     # The board that's used (for example nodemcuv2)
     self.board: Optional[str] = None
     # The full raw configuration
     self.raw_config: Optional[ConfigType] = None
     # The validated configuration, this is None until the config has been validated
     self.config: Optional[ConfigType] = None
     # The pending tasks in the task queue (mostly for C++ generation)
     # This is a priority queue (with heapq)
     # Each item is a tuple of form: (-priority, unique number, task)
     self.event_loop = _FakeEventLoop()
     # Task counter for pending tasks
     self.task_counter = 0
     # The variable cache, for each ID this holds a MockObj of the variable obj
     self.variables: Dict[str, "MockObj"] = {}
     # A list of statements that go in the main setup() block
     self.main_statements: List["Statement"] = []
     # A list of statements to insert in the global block (includes and global variables)
     self.global_statements: List["Statement"] = []
     # A set of platformio libraries to add to the project
     self.libraries: List[Library] = []
     # A set of build flags to set in the platformio project
     self.build_flags: Set[str] = set()
     # A set of defines to set for the compile process in esphome/core/defines.h
     self.defines: Set["Define"] = set()
     # A set of strings of names of loaded integrations, used to find namespace ID conflicts
     self.loaded_integrations = set()
     # A set of component IDs to track what Component subclasses are declared
     self.component_ids = set()
     # Whether ESPHome was started in verbose mode
     self.verbose = False