diff --git a/esphome/config_validation.py b/esphome/config_validation.py index 19d4747575..afc800f3f2 100644 --- a/esphome/config_validation.py +++ b/esphome/config_validation.py @@ -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: