Allow manual set "Invert_display" (#5494)

This commit is contained in:
NP v/d Spek
2023-10-12 03:26:07 +02:00
committed by GitHub
parent 41f29c46d0
commit e35de626a4
3 changed files with 19 additions and 5 deletions
+5
View File
@@ -54,6 +54,7 @@ COLOR_PALETTE = cv.one_of("NONE", "GRAYSCALE", "IMAGE_ADAPTIVE")
CONF_LED_PIN = "led_pin"
CONF_COLOR_PALETTE_IMAGES = "color_palette_images"
CONF_INVERT_DISPLAY = "invert_display"
def _validate(config):
@@ -100,6 +101,7 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_COLOR_PALETTE_IMAGES, default=[]): cv.ensure_list(
cv.file_
),
cv.Optional(CONF_INVERT_DISPLAY): cv.boolean,
}
)
.extend(cv.polling_component_schema("1s"))
@@ -176,3 +178,6 @@ async def to_code(config):
if rhs is not None:
prog_arr = cg.progmem_array(config[CONF_RAW_DATA_ID], rhs)
cg.add(var.set_palette(prog_arr))
if CONF_INVERT_DISPLAY in config:
cg.add(var.invert_display(config[CONF_INVERT_DISPLAY]))