1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-17 17:23:45 +01:00

Initial ESP32-C3-DevKitM-1 board support (#2062)

Co-authored-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
Stefan Agner
2021-07-26 11:10:56 +02:00
committed by GitHub
parent 159744e09e
commit d9f09a7523
10 changed files with 984 additions and 887 deletions

View File

@@ -20,6 +20,7 @@ from esphome.coroutine import FakeEventLoop as _FakeEventLoop
from esphome.coroutine import coroutine, coroutine_with_priority # noqa
from esphome.helpers import ensure_unique_string, is_hassio
from esphome.util import OrderedDict
from esphome import boards
if TYPE_CHECKING:
from ..cpp_generator import MockObj, MockObjClass, Statement
@@ -593,10 +594,20 @@ class EsphomeCore:
@property
def is_esp32(self):
"""Check if the ESP32 platform is used.
This checks if the ESP32 platform is in use, which
support ESP32 as well as other chips such as ESP32-C3
"""
if self.esp_platform is None:
raise ValueError("No platform specified")
return self.esp_platform == "ESP32"
@property
def is_esp32_c3(self):
"""Check if the ESP32-C3 SoC is being used."""
return self.is_esp32 and self.board in boards.ESP32_C3_BOARD_PINS
def add_job(self, func, *args, **kwargs):
self.event_loop.add_job(func, *args, **kwargs)