mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[fastled_clockless, fastled_spi] Add suggested alternate when using IDF (#9784)
This commit is contained in:
		| @@ -2,7 +2,13 @@ from esphome import pins | |||||||
| import esphome.codegen as cg | import esphome.codegen as cg | ||||||
| from esphome.components import fastled_base | from esphome.components import fastled_base | ||||||
| import esphome.config_validation as cv | import esphome.config_validation as cv | ||||||
| from esphome.const import CONF_CHIPSET, CONF_NUM_LEDS, CONF_PIN, CONF_RGB_ORDER | from esphome.const import ( | ||||||
|  |     CONF_CHIPSET, | ||||||
|  |     CONF_NUM_LEDS, | ||||||
|  |     CONF_PIN, | ||||||
|  |     CONF_RGB_ORDER, | ||||||
|  |     Framework, | ||||||
|  | ) | ||||||
|  |  | ||||||
| AUTO_LOAD = ["fastled_base"] | AUTO_LOAD = ["fastled_base"] | ||||||
|  |  | ||||||
| @@ -48,13 +54,22 @@ CONFIG_SCHEMA = cv.All( | |||||||
|             cv.Required(CONF_PIN): pins.internal_gpio_output_pin_number, |             cv.Required(CONF_PIN): pins.internal_gpio_output_pin_number, | ||||||
|         } |         } | ||||||
|     ), |     ), | ||||||
|     _validate, |     cv.only_with_framework( | ||||||
|  |         frameworks=Framework.ARDUINO, | ||||||
|  |         suggestions={ | ||||||
|  |             Framework.ESP_IDF: ( | ||||||
|  |                 "esp32_rmt_led_strip", | ||||||
|  |                 "light/esp32_rmt_led_strip", | ||||||
|  |             ) | ||||||
|  |         }, | ||||||
|  |     ), | ||||||
|     cv.require_framework_version( |     cv.require_framework_version( | ||||||
|         esp8266_arduino=cv.Version(2, 7, 4), |         esp8266_arduino=cv.Version(2, 7, 4), | ||||||
|         esp32_arduino=cv.Version(99, 0, 0), |         esp32_arduino=cv.Version(99, 0, 0), | ||||||
|         max_version=True, |         max_version=True, | ||||||
|         extra_message="Please see note on documentation for FastLED", |         extra_message="Please see note on documentation for FastLED", | ||||||
|     ), |     ), | ||||||
|  |     _validate, | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ from esphome.const import ( | |||||||
|     CONF_DATA_RATE, |     CONF_DATA_RATE, | ||||||
|     CONF_NUM_LEDS, |     CONF_NUM_LEDS, | ||||||
|     CONF_RGB_ORDER, |     CONF_RGB_ORDER, | ||||||
|  |     Framework, | ||||||
| ) | ) | ||||||
|  |  | ||||||
| AUTO_LOAD = ["fastled_base"] | AUTO_LOAD = ["fastled_base"] | ||||||
| @@ -33,6 +34,15 @@ CONFIG_SCHEMA = cv.All( | |||||||
|             cv.Optional(CONF_DATA_RATE): cv.frequency, |             cv.Optional(CONF_DATA_RATE): cv.frequency, | ||||||
|         } |         } | ||||||
|     ), |     ), | ||||||
|  |     cv.only_with_framework( | ||||||
|  |         frameworks=Framework.ARDUINO, | ||||||
|  |         suggestions={ | ||||||
|  |             Framework.ESP_IDF: ( | ||||||
|  |                 "spi_led_strip", | ||||||
|  |                 "light/spi_led_strip", | ||||||
|  |             ) | ||||||
|  |         }, | ||||||
|  |     ), | ||||||
|     cv.require_framework_version( |     cv.require_framework_version( | ||||||
|         esp8266_arduino=cv.Version(2, 7, 4), |         esp8266_arduino=cv.Version(2, 7, 4), | ||||||
|         esp32_arduino=cv.Version(99, 0, 0), |         esp32_arduino=cv.Version(99, 0, 0), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user