1414 ServiceResponse ,
1515 SupportsResponse ,
1616)
17+ from homeassistant .helpers .httpx_client import get_async_client
1718from homeassistant .helpers .location import find_coordinates
1819from homeassistant .helpers .selector import (
1920 BooleanSelector ,
4647 VEHICLE_TYPES ,
4748)
4849from .coordinator import WazeTravelTimeCoordinator , async_get_travel_times
49- from .httpx_client import create_httpx_client
5050
5151PLATFORMS = [Platform .SENSOR ]
5252
@@ -106,8 +106,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
106106 if SEMAPHORE not in hass .data .setdefault (DOMAIN , {}):
107107 hass .data .setdefault (DOMAIN , {})[SEMAPHORE ] = asyncio .Semaphore (1 )
108108
109- httpx_client = await create_httpx_client (hass )
110-
109+ httpx_client = get_async_client (hass )
111110 client = WazeRouteCalculator (
112111 region = config_entry .data [CONF_REGION ].upper (), client = httpx_client
113112 )
@@ -120,7 +119,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
120119 await hass .config_entries .async_forward_entry_setups (config_entry , PLATFORMS )
121120
122121 async def async_get_travel_times_service (service : ServiceCall ) -> ServiceResponse :
123- httpx_client = await create_httpx_client (hass )
122+ httpx_client = get_async_client (hass )
124123 client = WazeRouteCalculator (
125124 region = service .data [CONF_REGION ].upper (), client = httpx_client
126125 )
0 commit comments