diff --git a/esphome/components/waveshare_epaper/display.py b/esphome/components/waveshare_epaper/display.py index 77a0bbc689..cb7de80918 100644 --- a/esphome/components/waveshare_epaper/display.py +++ b/esphome/components/waveshare_epaper/display.py @@ -24,7 +24,7 @@ MODELS = { '2.90in': ('a', WaveshareEPaperTypeAModel.WAVESHARE_EPAPER_2_9_IN), '2.70in': ('b', WaveshareEPaper2P7In), '4.20in': ('b', WaveshareEPaper4P2In), - '7.50in': ('b', WaveshareEPaperTypeBModel), + '7.50in': ('b', WaveshareEPaper7P5In), } diff --git a/esphome/platformio_api.py b/esphome/platformio_api.py index adadab4109..1656f1ad33 100644 --- a/esphome/platformio_api.py +++ b/esphome/platformio_api.py @@ -7,6 +7,7 @@ import re import subprocess from esphome.core import CORE +from esphome.py_compat import IS_PY2 from esphome.util import run_external_command, run_external_process _LOGGER = logging.getLogger(__name__) @@ -17,12 +18,10 @@ def patch_structhash(): # removed/added. This might have unintended consequences, but this improves compile # times greatly when adding/removing components and a simple clean build solves # all issues + # pylint: disable=no-member,no-name-in-module from platformio.commands import run from platformio import util - try: - from platformio.util import get_project_dir - except ImportError: - from platformio.project.helpers import get_project_dir + from platformio.util import get_project_dir from os.path import join, isdir, getmtime, isfile from os import makedirs @@ -69,7 +68,8 @@ def run_platformio_cli(*args, **kwargs): if os.environ.get('ESPHOME_USE_SUBPROCESS') is None: import platformio.__main__ try: - patch_structhash() + if IS_PY2: + patch_structhash() except Exception: # pylint: disable=broad-except # Ignore when patch fails pass