Move shared constant in zabbix (#125744)

pull/124650/head^2
epenet 2024-09-11 16:08:12 +02:00 committed by GitHub
parent a7b6652fba
commit cee14afc03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -0,0 +1,3 @@
"""Constants for Zabbix."""
DOMAIN = "zabbix"

View File

@ -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