Skip to content

Commit

Permalink
run flake8 and remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow committed Jun 29, 2024
1 parent 9e8df2b commit 1635d51
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 24 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ repos:
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
Expand Down
2 changes: 0 additions & 2 deletions custom_components/cover_time_based/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

from .const import CONF_ENTITY_DOWN
from .const import CONF_ENTITY_UP
from .const import CONF_INVERT
from .const import CONF_TARGET_DEVICE_CLASS

_LOGGER = logging.getLogger(__name__)

Expand Down
7 changes: 0 additions & 7 deletions custom_components/cover_time_based/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@
from typing import Any

import voluptuous as vol
from homeassistant.components.cover import CoverDeviceClass
from homeassistant.const import CONF_ENTITY_ID
from homeassistant.const import CONF_NAME
from homeassistant.const import Platform
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers import selector
from homeassistant.helpers.schema_config_entry_flow import SchemaConfigFlowHandler
from homeassistant.helpers.schema_config_entry_flow import SchemaFlowFormStep
from homeassistant.helpers.schema_config_entry_flow import (
wrapped_entity_config_entry_title,
)

from .const import CONF_ENTITY_DOWN
from .const import CONF_ENTITY_UP
from .const import CONF_INVERT
from .const import CONF_TARGET_DEVICE_CLASS
from .const import CONF_TIME_CLOSE
from .const import CONF_TIME_OPEN
from .const import DOMAIN
Expand Down
2 changes: 0 additions & 2 deletions custom_components/cover_time_based/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

DOMAIN: Final = "cover_time_based"

CONF_INVERT: Final = "invert"
CONF_TARGET_DEVICE_CLASS: Final = "target_device"
CONF_ENTITY_UP: Final = "up"
CONF_ENTITY_DOWN: Final = "down"
CONF_TIME_OPEN: Final = "time_open"
Expand Down
13 changes: 0 additions & 13 deletions custom_components/cover_time_based/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,22 @@

import logging
from datetime import timedelta
from typing import Any

from homeassistant.components.cover import ATTR_CURRENT_POSITION
from homeassistant.components.cover import ATTR_POSITION
from homeassistant.components.cover import CoverEntity
from homeassistant.components.cover import CoverEntityFeature
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.components.cover import PLATFORM_SCHEMA
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.const import CONF_ENTITY_ID
from homeassistant.const import CONF_NAME
from homeassistant.const import SERVICE_CLOSE_COVER
from homeassistant.const import SERVICE_OPEN_COVER
from homeassistant.const import SERVICE_STOP_COVER
from homeassistant.const import SERVICE_TURN_OFF
from homeassistant.const import SERVICE_TURN_ON
from homeassistant.const import STATE_ON
from homeassistant.core import callback
from homeassistant.core import Event
from homeassistant.core import EventStateChangedData
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.device_registry import DeviceEntry
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.helpers.event import async_track_utc_time_change
from homeassistant.helpers.restore_state import RestoreEntity
from homeassistant.util import slugify

Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
max-line-length = 100
select = W,B,F,E711,E712,E901
extend-ignore = E203,B005,F811,F821,F403,F405,W503
exclude = .git,.eggs,__pycache__,build,dist,venv
max-complexity = 11

0 comments on commit 1635d51

Please sign in to comment.