Skip to content

Commit

Permalink
Fix for HA ≤2023.10
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Jan 1, 2025
1 parent f71c308 commit 05b2d72
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
)
from homeassistant.const import __version__ as ha_version
from homeassistant.core import Context, Event, HomeAssistant, State
from homeassistant.core_config import async_process_ha_core_config
from homeassistant.helpers import area_registry as ar
from homeassistant.helpers import entity_registry
from homeassistant.helpers.entity_platform import async_get_platforms
Expand Down Expand Up @@ -362,6 +361,19 @@ async def test_adaptive_lighting_switches(hass):
assert len(data.keys()) == 5


def async_process_ha_core_config(hass, config):
"""Set up the Home Assistant configuration."""
try:
# ha >= "2023.11.0"
from homeassistant.core_config import async_process_ha_core_config

return async_process_ha_core_config(hass, config)
except ModuleNotFoundError:
import homeassistant.config as config_util

return config_util.async_process_ha_core_config()


@pytest.mark.parametrize(("lat", "long", "timezone"), LAT_LONG_TZS)
async def test_adaptive_lighting_time_zones_with_default_settings(
hass,
Expand Down

0 comments on commit 05b2d72

Please sign in to comment.