Add pjlink const (#91749)
* Add pjlink const This is a precursor * Use DOMAIN const in pjlink media player * fixup! Add pjlink const
This commit is contained in:
parent
b3d50e67cd
commit
672fb44041
2 changed files with 12 additions and 8 deletions
8
homeassistant/components/pjlink/const.py
Normal file
8
homeassistant/components/pjlink/const.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
"""Constants for the PJLink integration."""
|
||||
|
||||
CONF_ENCODING = "encoding"
|
||||
|
||||
DEFAULT_PORT = 4352
|
||||
DEFAULT_ENCODING = "utf-8"
|
||||
|
||||
DOMAIN = "pjlink"
|
|
@ -19,11 +19,7 @@ import homeassistant.helpers.config_validation as cv
|
|||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
CONF_ENCODING = "encoding"
|
||||
|
||||
DEFAULT_PORT = 4352
|
||||
DEFAULT_ENCODING = "utf-8"
|
||||
DEFAULT_TIMEOUT = 10
|
||||
from .const import CONF_ENCODING, DEFAULT_ENCODING, DEFAULT_PORT, DOMAIN
|
||||
|
||||
ERR_PROJECTOR_UNAVAILABLE = "projector unavailable"
|
||||
|
||||
|
@ -51,9 +47,9 @@ def setup_platform(
|
|||
encoding = config.get(CONF_ENCODING)
|
||||
password = config.get(CONF_PASSWORD)
|
||||
|
||||
if "pjlink" not in hass.data:
|
||||
hass.data["pjlink"] = {}
|
||||
hass_data = hass.data["pjlink"]
|
||||
if DOMAIN not in hass.data:
|
||||
hass.data[DOMAIN] = {}
|
||||
hass_data = hass.data[DOMAIN]
|
||||
|
||||
device_label = f"{host}:{port}"
|
||||
if device_label in hass_data:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue