mirror of
https://github.com/esphome/esphome.git
synced 2025-10-14 07:43:48 +01:00
Use platform consts (#5508)
This commit is contained in:
@@ -15,6 +15,12 @@ from esphome.const import (
|
||||
KEY_CORE,
|
||||
KEY_TARGET_FRAMEWORK,
|
||||
KEY_TARGET_PLATFORM,
|
||||
PLATFORM_ESP32,
|
||||
PLATFORM_ESP8266,
|
||||
PLATFORM_BK72XX,
|
||||
PLATFORM_RTL87XX,
|
||||
PLATFORM_RP2040,
|
||||
PLATFORM_HOST,
|
||||
)
|
||||
from esphome.coroutine import FakeAwaitable as _FakeAwaitable
|
||||
from esphome.coroutine import FakeEventLoop as _FakeEventLoop
|
||||
@@ -598,23 +604,23 @@ class EsphomeCore:
|
||||
|
||||
@property
|
||||
def is_esp8266(self):
|
||||
return self.target_platform == "esp8266"
|
||||
return self.target_platform == PLATFORM_ESP8266
|
||||
|
||||
@property
|
||||
def is_esp32(self):
|
||||
return self.target_platform == "esp32"
|
||||
return self.target_platform == PLATFORM_ESP32
|
||||
|
||||
@property
|
||||
def is_rp2040(self):
|
||||
return self.target_platform == "rp2040"
|
||||
return self.target_platform == PLATFORM_RP2040
|
||||
|
||||
@property
|
||||
def is_bk72xx(self):
|
||||
return self.target_platform == "bk72xx"
|
||||
return self.target_platform == PLATFORM_BK72XX
|
||||
|
||||
@property
|
||||
def is_rtl87xx(self):
|
||||
return self.target_platform == "rtl87xx"
|
||||
return self.target_platform == PLATFORM_RTL87XX
|
||||
|
||||
@property
|
||||
def is_libretiny(self):
|
||||
@@ -622,7 +628,7 @@ class EsphomeCore:
|
||||
|
||||
@property
|
||||
def is_host(self):
|
||||
return self.target_platform == "host"
|
||||
return self.target_platform == PLATFORM_HOST
|
||||
|
||||
@property
|
||||
def target_framework(self):
|
||||
|
Reference in New Issue
Block a user