mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Fix error with require_framework_version and rp2040 (#3923)
This commit is contained in:
parent
22e0a944c8
commit
f8ce597918
1 changed files with 18 additions and 1 deletions
|
@ -44,6 +44,7 @@ from esphome.const import (
|
|||
KEY_CORE,
|
||||
KEY_FRAMEWORK_VERSION,
|
||||
KEY_TARGET_FRAMEWORK,
|
||||
KEY_TARGET_PLATFORM,
|
||||
)
|
||||
from esphome.core import (
|
||||
CORE,
|
||||
|
@ -1734,6 +1735,7 @@ def require_framework_version(
|
|||
esp_idf=None,
|
||||
esp32_arduino=None,
|
||||
esp8266_arduino=None,
|
||||
rp2040_arduino=None,
|
||||
max_version=False,
|
||||
extra_message=None,
|
||||
):
|
||||
|
@ -1761,8 +1763,23 @@ def require_framework_version(
|
|||
msg += f". {extra_message}"
|
||||
raise Invalid(msg)
|
||||
required = esp8266_arduino
|
||||
elif CORE.is_rp2040 and framework == "arduino":
|
||||
if rp2040_arduino is None:
|
||||
msg = "This feature is incompatible with RP2040"
|
||||
if extra_message:
|
||||
msg += f". {extra_message}"
|
||||
raise Invalid(msg)
|
||||
required = rp2040_arduino
|
||||
else:
|
||||
raise NotImplementedError
|
||||
raise Invalid(
|
||||
f"""
|
||||
Internal Error: require_framework_version does not support this platform configuration
|
||||
platform: {core_data[KEY_TARGET_PLATFORM]}
|
||||
framework: {framework}
|
||||
|
||||
Please report this issue on GitHub -> https://github.com/esphome/issues/issues/new?template=bug_report.yml.
|
||||
"""
|
||||
)
|
||||
|
||||
if max_version:
|
||||
if core_data[KEY_FRAMEWORK_VERSION] > required:
|
||||
|
|
Loading…
Reference in a new issue