diff --git a/homeassistant/components/zabbix/__init__.py b/homeassistant/components/zabbix/__init__.py index 851af54da32..924903b241d 100644 --- a/homeassistant/components/zabbix/__init__.py +++ b/homeassistant/components/zabbix/__init__.py @@ -34,13 +34,14 @@ from homeassistant.helpers.entityfilter import ( ) from homeassistant.helpers.typing import ConfigType +from .const import DOMAIN + _LOGGER = logging.getLogger(__name__) CONF_PUBLISH_STATES_HOST = "publish_states_host" DEFAULT_SSL = False DEFAULT_PATH = "zabbix" -DOMAIN = "zabbix" TIMEOUT = 5 RETRY_DELAY = 20 diff --git a/homeassistant/components/zabbix/const.py b/homeassistant/components/zabbix/const.py new file mode 100644 index 00000000000..5f710381f38 --- /dev/null +++ b/homeassistant/components/zabbix/const.py @@ -0,0 +1,3 @@ +"""Constants for Zabbix.""" + +DOMAIN = "zabbix" diff --git a/homeassistant/components/zabbix/sensor.py b/homeassistant/components/zabbix/sensor.py index 2187deb22e8..7cf1ed43cd9 100644 --- a/homeassistant/components/zabbix/sensor.py +++ b/homeassistant/components/zabbix/sensor.py @@ -19,7 +19,7 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType, StateType -from .. import zabbix +from .const import DOMAIN _LOGGER = logging.getLogger(__name__) @@ -52,7 +52,7 @@ def setup_platform( """Set up the Zabbix sensor platform.""" sensors: list[ZabbixTriggerCountSensor] = [] - if not (zapi := hass.data[zabbix.DOMAIN]): + if not (zapi := hass.data[DOMAIN]): _LOGGER.error("Zabbix integration hasn't been loaded? zapi is None") return