1 """Constants for the Nina integration."""
3 from __future__
import annotations
5 from datetime
import timedelta
6 from logging
import Logger, getLogger
7 from typing
import Final
9 _LOGGER: Logger = getLogger(__package__)
15 NO_MATCH_REGEX: str =
"/(?!)/"
16 ALL_MATCH_REGEX: str =
".*"
18 CONF_REGIONS: str =
"regions"
19 CONF_MESSAGE_SLOTS: str =
"slots"
20 CONF_FILTER_CORONA: str =
"corona_filter"
21 CONF_HEADLINE_FILTER: str =
"headline_filter"
22 CONF_AREA_FILTER: str =
"area_filter"
24 ATTR_HEADLINE: str =
"headline"
25 ATTR_DESCRIPTION: str =
"description"
26 ATTR_SENDER: str =
"sender"
27 ATTR_SEVERITY: str =
"severity"
28 ATTR_RECOMMENDED_ACTIONS: str =
"recommended_actions"
29 ATTR_AFFECTED_AREAS: str =
"affected_areas"
32 ATTR_SENT: str =
"sent"
33 ATTR_START: str =
"start"
34 ATTR_EXPIRES: str =
"expires"
36 CONST_LIST_A_TO_D: list[str] = [
"A",
"Ä",
"B",
"C",
"D"]
37 CONST_LIST_E_TO_H: list[str] = [
"E",
"F",
"G",
"H"]
38 CONST_LIST_I_TO_L: list[str] = [
"I",
"J",
"K",
"L"]
39 CONST_LIST_M_TO_Q: list[str] = [
"M",
"N",
"O",
"Ö",
"P",
"Q"]
40 CONST_LIST_R_TO_U: list[str] = [
"R",
"S",
"T",
"U",
"Ü"]
41 CONST_LIST_V_TO_Z: list[str] = [
"V",
"W",
"X",
"Y",
"Z"]
43 CONST_REGION_A_TO_D: Final =
"_a_to_d"
44 CONST_REGION_E_TO_H: Final =
"_e_to_h"
45 CONST_REGION_I_TO_L: Final =
"_i_to_l"
46 CONST_REGION_M_TO_Q: Final =
"_m_to_q"
47 CONST_REGION_R_TO_U: Final =
"_r_to_u"
48 CONST_REGION_V_TO_Z: Final =
"_v_to_z"
49 CONST_REGIONS: Final = [
58 CONST_REGION_MAPPING: dict[str, list[str]] = {
59 CONST_REGION_A_TO_D: CONST_LIST_A_TO_D,
60 CONST_REGION_E_TO_H: CONST_LIST_E_TO_H,
61 CONST_REGION_I_TO_L: CONST_LIST_I_TO_L,
62 CONST_REGION_M_TO_Q: CONST_LIST_M_TO_Q,
63 CONST_REGION_R_TO_U: CONST_LIST_R_TO_U,
64 CONST_REGION_V_TO_Z: CONST_LIST_V_TO_Z,