Update esphome/components/waveshare_epaper/display.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Johannes 2024-08-13 22:14:14 +02:00 committed by GitHub
parent eeec0621dd
commit d294d2d721
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -210,10 +210,10 @@ async def to_code(config):
dc = await cg.gpio_pin_expression(config[CONF_DC_PIN]) dc = await cg.gpio_pin_expression(config[CONF_DC_PIN])
cg.add(var.set_dc_pin(dc)) cg.add(var.set_dc_pin(dc))
if CONF_NUM_SEGMENTS_X in config: if num_segments_x := config.get(CONF_NUM_SEGMENTS_X):
cg.add(var.set_num_segments_x(config["num_segments_x"])) cg.add(var.set_num_segments_x(num_segments_x))
if CONF_NUM_SEGMENTS_Y in config: if num_segments_y := config.get(CONF_NUM_SEGMENTS_Y):
cg.add(var.set_num_segments_y(config["num_segments_y"])) cg.add(var.set_num_segments_y(num_segments_y))
if CONF_LAMBDA in config: if CONF_LAMBDA in config:
lambda_ = await cg.process_lambda( lambda_ = await cg.process_lambda(
config[CONF_LAMBDA], [(display.DisplayRef, "it")], return_type=cg.void config[CONF_LAMBDA], [(display.DisplayRef, "it")], return_type=cg.void