1 """The aurora component."""
3 from __future__
import annotations
5 from datetime
import timedelta
7 from typing
import TYPE_CHECKING
9 from aiohttp
import ClientError
10 from auroranoaa
import AuroraForecast
17 from .const
import CONF_THRESHOLD, DEFAULT_THRESHOLD
20 from .
import AuroraConfigEntry
22 _LOGGER = logging.getLogger(__name__)
26 """Class to manage fetching data from the NOAA Aurora API."""
28 config_entry: AuroraConfigEntry
30 def __init__(self, hass: HomeAssistant) ->
None:
31 """Initialize the data updater."""
44 self.
config_entryconfig_entry.options.get(CONF_THRESHOLD, DEFAULT_THRESHOLD)
48 """Fetch the data from the NOAA Aurora Forecast."""
52 except ClientError
as error:
53 raise UpdateFailed(f
"Error updating from NOAA: {error}")
from error
None __init__(self, HomeAssistant hass)
int _async_update_data(self)
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)