Use assignment expressions 12 (#57937)
This commit is contained in:
parent
7353ea5416
commit
4513ee4ea5
21 changed files with 30 additions and 62 deletions
|
@ -34,16 +34,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
"""Set up the Zabbix sensor platform."""
|
||||
sensors = []
|
||||
|
||||
zapi = hass.data[zabbix.DOMAIN]
|
||||
if not zapi:
|
||||
if not (zapi := hass.data[zabbix.DOMAIN]):
|
||||
_LOGGER.error("Zabbix integration hasn't been loaded? zapi is None")
|
||||
return False
|
||||
|
||||
_LOGGER.info("Connected to Zabbix API Version %s", zapi.api_version())
|
||||
|
||||
trigger_conf = config.get(_CONF_TRIGGERS)
|
||||
# The following code seems overly complex. Need to think about this...
|
||||
if trigger_conf:
|
||||
if trigger_conf := config.get(_CONF_TRIGGERS):
|
||||
hostids = trigger_conf.get(_CONF_HOSTIDS)
|
||||
individual = trigger_conf.get(_CONF_INDIVIDUAL)
|
||||
name = trigger_conf.get(CONF_NAME)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue