mirror of
https://github.com/esphome/esphome.git
synced 2025-01-18 20:10:55 +00:00
[spi] relay on KEY_TARGET_PLATFORM as the other platforms does (#8066)
This commit is contained in:
parent
40bee2a854
commit
731fb1d172
@ -97,11 +97,7 @@ RP_SPI_PINSETS = [
|
|||||||
|
|
||||||
|
|
||||||
def get_target_platform():
|
def get_target_platform():
|
||||||
return (
|
return CORE.data[KEY_CORE][KEY_TARGET_PLATFORM]
|
||||||
CORE.data[KEY_CORE][KEY_TARGET_PLATFORM]
|
|
||||||
if KEY_TARGET_PLATFORM in CORE.data[KEY_CORE]
|
|
||||||
else ""
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def get_target_variant():
|
def get_target_variant():
|
||||||
|
@ -5,7 +5,7 @@ from pathlib import Path
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from esphome.config import get_component, get_platform
|
from esphome.config import get_component, get_platform
|
||||||
from esphome.const import KEY_CORE, KEY_TARGET_FRAMEWORK
|
from esphome.const import KEY_CORE, KEY_TARGET_FRAMEWORK, KEY_TARGET_PLATFORM
|
||||||
from esphome.core import CORE
|
from esphome.core import CORE
|
||||||
from esphome.helpers import write_file_if_changed
|
from esphome.helpers import write_file_if_changed
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ parts = [BASE]
|
|||||||
|
|
||||||
# Fake some directory so that get_component works
|
# Fake some directory so that get_component works
|
||||||
CORE.config_path = str(root)
|
CORE.config_path = str(root)
|
||||||
CORE.data[KEY_CORE] = {KEY_TARGET_FRAMEWORK: None}
|
CORE.data[KEY_CORE] = {KEY_TARGET_FRAMEWORK: None, KEY_TARGET_PLATFORM: None}
|
||||||
|
|
||||||
codeowners = defaultdict(list)
|
codeowners = defaultdict(list)
|
||||||
|
|
||||||
|
@ -85,12 +85,12 @@ def load_components():
|
|||||||
|
|
||||||
|
|
||||||
# pylint: disable=wrong-import-position
|
# pylint: disable=wrong-import-position
|
||||||
from esphome.const import CONF_TYPE, KEY_CORE
|
from esphome.const import CONF_TYPE, KEY_CORE, KEY_TARGET_PLATFORM
|
||||||
from esphome.core import CORE
|
from esphome.core import CORE
|
||||||
|
|
||||||
# pylint: enable=wrong-import-position
|
# pylint: enable=wrong-import-position
|
||||||
|
|
||||||
CORE.data[KEY_CORE] = {}
|
CORE.data[KEY_CORE] = {KEY_TARGET_PLATFORM: None}
|
||||||
load_components()
|
load_components()
|
||||||
|
|
||||||
# Import esphome after loading components (so schema is tracked)
|
# Import esphome after loading components (so schema is tracked)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user