Adjust custom data location in hdmi_cec (#63791)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/63803/head
parent
24314f1b11
commit
06e2f58529
|
@ -333,7 +333,7 @@ def setup(hass: HomeAssistant, base_config: ConfigType) -> bool: # noqa: C901
|
||||||
def _new_device(device):
|
def _new_device(device):
|
||||||
"""Handle new devices which are detected by HDMI network."""
|
"""Handle new devices which are detected by HDMI network."""
|
||||||
key = f"{DOMAIN}.{device.name}"
|
key = f"{DOMAIN}.{device.name}"
|
||||||
hass.data[key] = device
|
hass.data[DOMAIN][key] = device
|
||||||
ent_platform = base_config[DOMAIN][CONF_TYPES].get(key, platform)
|
ent_platform = base_config[DOMAIN][CONF_TYPES].get(key, platform)
|
||||||
discovery.load_platform(
|
discovery.load_platform(
|
||||||
hass,
|
hass,
|
||||||
|
|
|
@ -66,7 +66,7 @@ def setup_platform(
|
||||||
_LOGGER.debug("Setting up HDMI devices %s", discovery_info[ATTR_NEW])
|
_LOGGER.debug("Setting up HDMI devices %s", discovery_info[ATTR_NEW])
|
||||||
entities = []
|
entities = []
|
||||||
for device in discovery_info[ATTR_NEW]:
|
for device in discovery_info[ATTR_NEW]:
|
||||||
hdmi_device = hass.data[device]
|
hdmi_device = hass.data[DOMAIN][device]
|
||||||
entities.append(CecPlayerEntity(hdmi_device, hdmi_device.logical_address))
|
entities.append(CecPlayerEntity(hdmi_device, hdmi_device.logical_address))
|
||||||
add_entities(entities, True)
|
add_entities(entities, True)
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ def setup_platform(
|
||||||
_LOGGER.info("Setting up HDMI devices %s", discovery_info[ATTR_NEW])
|
_LOGGER.info("Setting up HDMI devices %s", discovery_info[ATTR_NEW])
|
||||||
entities = []
|
entities = []
|
||||||
for device in discovery_info[ATTR_NEW]:
|
for device in discovery_info[ATTR_NEW]:
|
||||||
hdmi_device = hass.data[device]
|
hdmi_device = hass.data[DOMAIN][device]
|
||||||
entities.append(CecSwitchEntity(hdmi_device, hdmi_device.logical_address))
|
entities.append(CecSwitchEntity(hdmi_device, hdmi_device.logical_address))
|
||||||
add_entities(entities, True)
|
add_entities(entities, True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue