1
0
mirror of https://github.com/esphome/esphome.git synced 2025-06-18 06:15:46 +01:00

Lint the script folder files ()

This commit is contained in:
Jesse Hills
2023-12-22 20:03:47 +13:00
committed by GitHub
parent 676ae6b26e
commit d2d0058386
6 changed files with 398 additions and 377 deletions

@ -2,6 +2,7 @@
import re
# pylint: disable=import-error
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.button import ButtonDeviceClass
from homeassistant.components.cover import CoverDeviceClass
@ -9,6 +10,8 @@ from homeassistant.components.number import NumberDeviceClass
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.switch import SwitchDeviceClass
# pylint: enable=import-error
BLOCKLIST = (
# requires special support on HA side
"enum",
@ -25,10 +28,10 @@ DOMAINS = {
def sub(path, pattern, repl):
with open(path) as handle:
with open(path, encoding="utf-8") as handle:
content = handle.read()
content = re.sub(pattern, repl, content, flags=re.MULTILINE)
with open(path, "w") as handle:
with open(path, "w", encoding="utf-8") as handle:
handle.write(content)