From 8c9deff1262121fbb2e47acece5b86f693c90969 Mon Sep 17 00:00:00 2001 From: Thomas Schamm Date: Sat, 4 Dec 2021 22:56:25 +0100 Subject: [PATCH] Prettify --- .flake8 | 1 + .pre-commit-config.yaml | 1 + custom_components/bosch_shc/__init__.py | 1 - custom_components/bosch_shc/alarm_control_panel.py | 5 ++--- custom_components/bosch_shc/climate.py | 1 - custom_components/bosch_shc/cover.py | 1 - custom_components/bosch_shc/device_trigger.py | 1 - custom_components/bosch_shc/light.py | 1 - custom_components/bosch_shc/logbook.py | 1 - custom_components/bosch_shc/switch.py | 1 - 10 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.flake8 b/.flake8 index 93349d1..a0c0399 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,4 @@ [flake8] max-line-length = 88 +ignore = E501, W503 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a551aab..ecc2570 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,3 +4,4 @@ rev: v2.0.0 hooks: - id: flake8 + additional_dependencies: [flake8-docstrings] diff --git a/custom_components/bosch_shc/__init__.py b/custom_components/bosch_shc/__init__.py index faf6029..420d4eb 100644 --- a/custom_components/bosch_shc/__init__.py +++ b/custom_components/bosch_shc/__init__.py @@ -208,7 +208,6 @@ def _async_input_events_handler(self): async def async_setup(self): """Set up the listener.""" - device_registry = await dr.async_get_registry(self.hass) device_entry = device_registry.async_get_or_create( config_entry_id=self.entry.entry_id, diff --git a/custom_components/bosch_shc/alarm_control_panel.py b/custom_components/bosch_shc/alarm_control_panel.py index b43b66e..40a2023 100644 --- a/custom_components/bosch_shc/alarm_control_panel.py +++ b/custom_components/bosch_shc/alarm_control_panel.py @@ -17,14 +17,12 @@ ) from .const import DATA_SESSION, DOMAIN -from .entity import SHCEntity _LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the alarm control panel platform.""" - devices = [] session: SHCSession = hass.data[DOMAIN][config_entry.entry_id][DATA_SESSION] @@ -44,6 +42,7 @@ class IntrusionSystemAlarmControlPanel(AlarmControlPanelEntity): """Representation of SHC intrusion detection control.""" def __init__(self, device: SHCIntrusionSystem, parent_id: str, entry_id: str): + """Initialize the intrusion detection control.""" self._device = device self._parent_id = parent_id self._entry_id = entry_id @@ -139,7 +138,7 @@ def supported_features(self): @property def manufacturer(self): - """The manufacturer of the device.""" + """Return manufacturer of the device.""" return self._device.manufacturer @property diff --git a/custom_components/bosch_shc/climate.py b/custom_components/bosch_shc/climate.py index f06d431..dec6911 100644 --- a/custom_components/bosch_shc/climate.py +++ b/custom_components/bosch_shc/climate.py @@ -24,7 +24,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the SHC climate platform.""" - entities = [] session: SHCSession = hass.data[DOMAIN][config_entry.entry_id][DATA_SESSION] diff --git a/custom_components/bosch_shc/cover.py b/custom_components/bosch_shc/cover.py index b5582fa..ead2b31 100644 --- a/custom_components/bosch_shc/cover.py +++ b/custom_components/bosch_shc/cover.py @@ -16,7 +16,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the SHC cover platform.""" - entities = [] session: SHCSession = hass.data[DOMAIN][config_entry.entry_id][DATA_SESSION] diff --git a/custom_components/bosch_shc/device_trigger.py b/custom_components/bosch_shc/device_trigger.py index a7c36d8..e01f3ed 100644 --- a/custom_components/bosch_shc/device_trigger.py +++ b/custom_components/bosch_shc/device_trigger.py @@ -157,7 +157,6 @@ async def async_attach_trigger( automation_info: dict, ) -> CALLBACK_TYPE: """Attach a trigger.""" - event_config = None config = TRIGGER_SCHEMA(config) diff --git a/custom_components/bosch_shc/light.py b/custom_components/bosch_shc/light.py index 981c1c2..961f31d 100644 --- a/custom_components/bosch_shc/light.py +++ b/custom_components/bosch_shc/light.py @@ -89,7 +89,6 @@ def color_temp(self): def turn_on(self, **kwargs): """Turn the light on.""" - hs_color = kwargs.get(ATTR_HS_COLOR) color_temp = kwargs.get(ATTR_COLOR_TEMP) brightness = kwargs.get(ATTR_BRIGHTNESS) diff --git a/custom_components/bosch_shc/logbook.py b/custom_components/bosch_shc/logbook.py index 87ecbe0..73dcf73 100644 --- a/custom_components/bosch_shc/logbook.py +++ b/custom_components/bosch_shc/logbook.py @@ -13,7 +13,6 @@ def async_describe_events(hass, async_describe_event): @callback def async_describe_bosch_shc_event(event): """Describe bosch_shc.click logbook event.""" - device_name = event.data[ATTR_NAME] event_subtype = event.data[ATTR_EVENT_SUBTYPE] event_type = event.data[ATTR_EVENT_TYPE] diff --git a/custom_components/bosch_shc/switch.py b/custom_components/bosch_shc/switch.py index e006aa2..46392af 100644 --- a/custom_components/bosch_shc/switch.py +++ b/custom_components/bosch_shc/switch.py @@ -18,7 +18,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the SHC switch platform.""" - entities = [] session: SHCSession = hass.data[DOMAIN][config_entry.entry_id][DATA_SESSION]