diff --git a/esphome/components/graphical_display_menu/__init__.py b/esphome/components/graphical_display_menu/__init__.py index 2f19db876b..d7146a7381 100644 --- a/esphome/components/graphical_display_menu/__init__.py +++ b/esphome/components/graphical_display_menu/__init__.py @@ -1,20 +1,19 @@ -import esphome.codegen as cg -import esphome.config_validation as cv -from esphome.components import display, font, color -from esphome.const import ( - CONF_ID, - CONF_DISPLAY, - CONF_TRIGGER_ID, - CONF_FOREGROUND_COLOR, - CONF_BACKGROUND_COLOR, -) from esphome import automation, core - +import esphome.codegen as cg +from esphome.components import color, display, font from esphome.components.display_menu_base import ( DISPLAY_MENU_BASE_SCHEMA, DisplayMenuComponent, display_menu_to_code, ) +import esphome.config_validation as cv +from esphome.const import ( + CONF_BACKGROUND_COLOR, + CONF_DISPLAY, + CONF_FOREGROUND_COLOR, + CONF_ID, + CONF_TRIGGER_ID, +) CONF_FONT = "font" CONF_MENU_ITEM_VALUE = "menu_item_value" diff --git a/esphome/components/graphical_layout/__init__.py b/esphome/components/graphical_layout/__init__.py index 700a5d6755..a7542db5d5 100644 --- a/esphome/components/graphical_layout/__init__.py +++ b/esphome/components/graphical_layout/__init__.py @@ -1,13 +1,16 @@ import esphome.codegen as cg -import esphome.config_validation as cv -from esphome.const import CONF_ID, CONF_TYPE, CONF_BORDER from esphome.components import color -from . import horizontal_stack -from . import vertical_stack -from . import text_panel -from . import display_rendering_panel -from . import fixed_dimension_panel -from . import text_run_panel +import esphome.config_validation as cv +from esphome.const import CONF_BORDER, CONF_ID, CONF_TYPE + +from . import ( + display_rendering_panel, + fixed_dimension_panel, + horizontal_stack, + text_panel, + text_run_panel, + vertical_stack, +) graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout") RootLayoutComponent = graphical_layout_ns.class_("RootLayoutComponent", cg.Component) diff --git a/esphome/components/graphical_layout/display_rendering_panel.py b/esphome/components/graphical_layout/display_rendering_panel.py index f20e15ae6b..8a83b93539 100644 --- a/esphome/components/graphical_layout/display_rendering_panel.py +++ b/esphome/components/graphical_layout/display_rendering_panel.py @@ -1,7 +1,7 @@ import esphome.codegen as cg +from esphome.components.display import DisplayRef, display_ns import esphome.config_validation as cv -from esphome.const import CONF_WIDTH, CONF_HEIGHT, CONF_LAMBDA -from esphome.components.display import display_ns, DisplayRef +from esphome.const import CONF_HEIGHT, CONF_LAMBDA, CONF_WIDTH graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout") Rect = display_ns.class_("Rect") diff --git a/esphome/components/graphical_layout/fixed_dimension_panel.py b/esphome/components/graphical_layout/fixed_dimension_panel.py index 94b6652e43..da55997f36 100644 --- a/esphome/components/graphical_layout/fixed_dimension_panel.py +++ b/esphome/components/graphical_layout/fixed_dimension_panel.py @@ -1,6 +1,6 @@ import esphome.codegen as cg import esphome.config_validation as cv -from esphome.const import CONF_TYPE, CONF_WIDTH, CONF_HEIGHT +from esphome.const import CONF_HEIGHT, CONF_TYPE, CONF_WIDTH graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout") FixedDimensionPanel = graphical_layout_ns.class_("FixedDimensionPanel") diff --git a/esphome/components/graphical_layout/text_panel.py b/esphome/components/graphical_layout/text_panel.py index 655d2a3727..e77965971e 100644 --- a/esphome/components/graphical_layout/text_panel.py +++ b/esphome/components/graphical_layout/text_panel.py @@ -1,15 +1,14 @@ import esphome.codegen as cg -import esphome.config_validation as cv -from esphome.components import font, color, sensor, text_sensor, time +from esphome.components import color, font, sensor, text_sensor, time from esphome.components.display import display_ns +import esphome.config_validation as cv from esphome.const import ( - CONF_FOREGROUND_COLOR, CONF_BACKGROUND_COLOR, + CONF_FOREGROUND_COLOR, CONF_SENSOR, CONF_TIME_ID, ) - graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout") TextPanel = graphical_layout_ns.class_("TextPanel") TextAlign = display_ns.enum("TextAlign", is_class=True) diff --git a/esphome/components/graphical_layout/text_run_panel.py b/esphome/components/graphical_layout/text_run_panel.py index e72689a21a..c68b0312a7 100644 --- a/esphome/components/graphical_layout/text_run_panel.py +++ b/esphome/components/graphical_layout/text_run_panel.py @@ -1,17 +1,16 @@ import esphome.codegen as cg -from esphome.cpp_generator import CallExpression, MockObjClass, MockObj -from esphome.core import ID -import esphome.config_validation as cv -from esphome.components import font, color, sensor, text_sensor, time +from esphome.components import color, font, sensor, text_sensor, time from esphome.components.display import display_ns +import esphome.config_validation as cv from esphome.const import ( - CONF_ID, - CONF_FOREGROUND_COLOR, CONF_BACKGROUND_COLOR, + CONF_FOREGROUND_COLOR, + CONF_ID, CONF_SENSOR, CONF_TIME_ID, ) - +from esphome.core import ID +from esphome.cpp_generator import CallExpression, MockObj, MockObjClass SharedPtr = cg.std_ns.class_("shared_ptr") graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout") diff --git a/esphome/components/nextion/base_component.py b/esphome/components/nextion/base_component.py index 1cc2b43588..d12434ec8f 100644 --- a/esphome/components/nextion/base_component.py +++ b/esphome/components/nextion/base_component.py @@ -1,14 +1,11 @@ from string import ascii_letters, digits -import esphome.config_validation as cv + import esphome.codegen as cg from esphome.components import color -from esphome.const import ( - CONF_VISIBLE, - CONF_FOREGROUND_COLOR, - CONF_BACKGROUND_COLOR, -) -from . import CONF_NEXTION_ID -from . import Nextion +import esphome.config_validation as cv +from esphome.const import CONF_BACKGROUND_COLOR, CONF_FOREGROUND_COLOR, CONF_VISIBLE + +from . import CONF_NEXTION_ID, Nextion CONF_VARIABLE_NAME = "variable_name" CONF_COMPONENT_NAME = "component_name"