diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e42b9e64..e6701aec 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -github: [basnijholz, RubenKelevra] +github: [basnijholz, RubenKelevra] diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md index fcd16fc6..cc515a20 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.md +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -3,4 +3,3 @@ name: 'Enhancement' about: 'Suggest an improvement to an existing feature.' labels: kind/enhancement, need/triage --- - diff --git a/custom_components/adaptive_lighting/__init__.py b/custom_components/adaptive_lighting/__init__.py index f7be6292..33881c75 100755 --- a/custom_components/adaptive_lighting/__init__.py +++ b/custom_components/adaptive_lighting/__init__.py @@ -2,12 +2,11 @@ import logging from typing import Any -import voluptuous as vol - from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_SOURCE from homeassistant.core import HomeAssistant import homeassistant.helpers.config_validation as cv +import voluptuous as vol from .const import ( _DOMAIN_SCHEMA, diff --git a/custom_components/adaptive_lighting/config_flow.py b/custom_components/adaptive_lighting/config_flow.py index 8fa74f5c..d0f0bf2d 100644 --- a/custom_components/adaptive_lighting/config_flow.py +++ b/custom_components/adaptive_lighting/config_flow.py @@ -1,12 +1,11 @@ """Config flow for Adaptive Lighting integration.""" import logging -import voluptuous as vol - from homeassistant import config_entries from homeassistant.const import CONF_NAME from homeassistant.core import callback import homeassistant.helpers.config_validation as cv +import voluptuous as vol from .const import ( # pylint: disable=unused-import CONF_LIGHTS, diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index b182ed82..105a95fc 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -1,8 +1,7 @@ """Constants for the Adaptive Lighting integration.""" -import voluptuous as vol - from homeassistant.components.light import VALID_TRANSITION import homeassistant.helpers.config_validation as cv +import voluptuous as vol ICON = "mdi:theme-light-dark" diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index cd68e8d0..c7a39b17 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -15,8 +15,6 @@ import math from typing import Any import astral -import voluptuous as vol - from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_BRIGHTNESS_PCT, @@ -27,25 +25,27 @@ from homeassistant.components.light import ( ATTR_HS_COLOR, ATTR_KELVIN, ATTR_RGB_COLOR, + ATTR_SUPPORTED_COLOR_MODES, ATTR_TRANSITION, ATTR_XY_COLOR, - DOMAIN as LIGHT_DOMAIN, + COLOR_MODE_BRIGHTNESS, + COLOR_MODE_COLOR_TEMP, + COLOR_MODE_HS, + COLOR_MODE_RGB, + COLOR_MODE_RGBW, + COLOR_MODE_XY, +) +from homeassistant.components.light import ( SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_TRANSITION, VALID_TRANSITION, is_on, - COLOR_MODE_RGB, - COLOR_MODE_RGBW, - COLOR_MODE_HS, - COLOR_MODE_XY, - COLOR_MODE_COLOR_TEMP, - COLOR_MODE_BRIGHTNESS, - ATTR_SUPPORTED_COLOR_MODES, ) - -from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN, SwitchEntity +from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN +from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN +from homeassistant.components.switch import SwitchEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( ATTR_DOMAIN, @@ -88,6 +88,7 @@ from homeassistant.util.color import ( color_xy_to_hs, ) import homeassistant.util.dt as dt_util +import voluptuous as vol from .const import ( ADAPT_BRIGHTNESS_SWITCH, @@ -97,7 +98,6 @@ from .const import ( ATTR_TURN_ON_OFF_LISTENER, CONF_DETECT_NON_HA_CHANGES, CONF_INITIAL_TRANSITION, - CONF_SLEEP_TRANSITION, CONF_INTERVAL, CONF_LIGHTS, CONF_MANUAL_CONTROL, @@ -110,6 +110,7 @@ from .const import ( CONF_SEPARATE_TURN_ON_COMMANDS, CONF_SLEEP_BRIGHTNESS, CONF_SLEEP_COLOR_TEMP, + CONF_SLEEP_TRANSITION, CONF_SUNRISE_OFFSET, CONF_SUNRISE_TIME, CONF_SUNSET_OFFSET, diff --git a/custom_components/adaptive_lighting/translations/de.json b/custom_components/adaptive_lighting/translations/de.json index dae5af4e..24c1d07e 100644 --- a/custom_components/adaptive_lighting/translations/de.json +++ b/custom_components/adaptive_lighting/translations/de.json @@ -46,4 +46,4 @@ "option_error": "Fehlerhafte Option" } } -} \ No newline at end of file +} diff --git a/test_dependencies.py b/test_dependencies.py index 3886b747..a9c37648 100644 --- a/test_dependencies.py +++ b/test_dependencies.py @@ -1,5 +1,3 @@ -from collections import defaultdict - with open("core/requirements_test_all.txt") as f: lines = f.readlines() diff --git a/tests/test_switch.py b/tests/test_switch.py index ff759537..de19045f 100644 --- a/tests/test_switch.py +++ b/tests/test_switch.py @@ -755,7 +755,7 @@ def test_attributes_have_changed(): @pytest.mark.parametrize("wait", [True, False]) async def test_expand_light_groups(hass, wait): """Test expanding light groups.""" - await setup_switch(hass, {}) + await setup_lights_and_switch(hass, {}) lights = ["light.ceiling_lights", "light.kitchen_lights"] await async_setup_component( hass,