[code-quality] Organise esp8266 python imports

This commit is contained in:
Jesse Hills 2024-07-22 13:24:25 +12:00
parent a464e46d4d
commit c29277dc92
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A
2 changed files with 9 additions and 11 deletions

View file

@ -1,10 +1,13 @@
import logging import logging
import os import os
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.const import ( from esphome.const import (
CONF_BOARD, CONF_BOARD,
CONF_BOARD_FLASH_MODE, CONF_BOARD_FLASH_MODE,
CONF_FRAMEWORK, CONF_FRAMEWORK,
CONF_PLATFORM_VERSION,
CONF_SOURCE, CONF_SOURCE,
CONF_VERSION, CONF_VERSION,
KEY_CORE, KEY_CORE,
@ -12,27 +15,22 @@ from esphome.const import (
KEY_TARGET_FRAMEWORK, KEY_TARGET_FRAMEWORK,
KEY_TARGET_PLATFORM, KEY_TARGET_PLATFORM,
PLATFORM_ESP8266, PLATFORM_ESP8266,
CONF_PLATFORM_VERSION,
) )
from esphome.core import CORE, coroutine_with_priority from esphome.core import CORE, coroutine_with_priority
import esphome.config_validation as cv
import esphome.codegen as cg
from esphome.helpers import copy_file_if_changed from esphome.helpers import copy_file_if_changed
from .boards import BOARDS, ESP8266_LD_SCRIPTS
from .const import ( from .const import (
CONF_RESTORE_FROM_FLASH,
CONF_EARLY_PIN_INIT, CONF_EARLY_PIN_INIT,
CONF_RESTORE_FROM_FLASH,
KEY_BOARD, KEY_BOARD,
KEY_ESP8266, KEY_ESP8266,
KEY_FLASH_SIZE, KEY_FLASH_SIZE,
KEY_PIN_INITIAL_STATES, KEY_PIN_INITIAL_STATES,
esp8266_ns, esp8266_ns,
) )
from .boards import BOARDS, ESP8266_LD_SCRIPTS
from .gpio import PinInitialState, add_pin_initial_states_array from .gpio import PinInitialState, add_pin_initial_states_array
CODEOWNERS = ["@esphome/core"] CODEOWNERS = ["@esphome/core"]
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
AUTO_LOAD = ["preferences"] AUTO_LOAD = ["preferences"]

View file

@ -1,6 +1,9 @@
import logging
from dataclasses import dataclass from dataclasses import dataclass
import logging
from esphome import pins
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.const import ( from esphome.const import (
CONF_ANALOG, CONF_ANALOG,
CONF_ID, CONF_ID,
@ -14,10 +17,7 @@ from esphome.const import (
CONF_PULLUP, CONF_PULLUP,
PLATFORM_ESP8266, PLATFORM_ESP8266,
) )
from esphome import pins
from esphome.core import CORE, coroutine_with_priority from esphome.core import CORE, coroutine_with_priority
import esphome.config_validation as cv
import esphome.codegen as cg
from . import boards from . import boards
from .const import KEY_BOARD, KEY_ESP8266, KEY_PIN_INITIAL_STATES, esp8266_ns from .const import KEY_BOARD, KEY_ESP8266, KEY_PIN_INITIAL_STATES, esp8266_ns