mirror of
https://github.com/esphome/esphome.git
synced 2025-06-18 06:15:46 +01:00
Lint the script folder files (#5991)
This commit is contained in:
@ -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)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user