mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Revert "Third batch of (minor) fixes as suggested by @balloob"
This reverts commit 87c138c5593ae7c9c7e4b1a20858c96d5a9f6b82.
This commit is contained in:
parent
199fbc7a15
commit
a687bdb388
@ -22,7 +22,6 @@ from homeassistant.const import EVENT_HOMEASSISTANT_STOP, \
|
|||||||
ATTR_DISCOVERED, \
|
ATTR_DISCOVERED, \
|
||||||
STATE_UNKNOWN
|
STATE_UNKNOWN
|
||||||
from homeassistant.loader import get_component
|
from homeassistant.loader import get_component
|
||||||
from homeassistant.helpers import discovery
|
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
import homeassistant.bootstrap
|
import homeassistant.bootstrap
|
||||||
|
|
||||||
@ -151,11 +150,25 @@ def system_callback_handler(hass, config, src, *args):
|
|||||||
# they are setup in HA and an event is fired
|
# they are setup in HA and an event is fired
|
||||||
if found_devices:
|
if found_devices:
|
||||||
component = get_component(component_name)
|
component = get_component(component_name)
|
||||||
|
config = {component.DOMAIN: found_devices}
|
||||||
|
|
||||||
# HA discovery event
|
# Ensure component is loaded
|
||||||
discovery.load_platform(hass, component, DOMAIN, {
|
homeassistant.bootstrap.setup_component(
|
||||||
ATTR_DISCOVER_DEVICES: found_devices
|
hass,
|
||||||
}, config)
|
component.DOMAIN,
|
||||||
|
config)
|
||||||
|
|
||||||
|
# Fire discovery event
|
||||||
|
hass.bus.fire(
|
||||||
|
EVENT_PLATFORM_DISCOVERED, {
|
||||||
|
ATTR_SERVICE: discovery_type,
|
||||||
|
ATTR_DISCOVERED: {
|
||||||
|
ATTR_DISCOVER_DEVICES:
|
||||||
|
found_devices,
|
||||||
|
ATTR_DISCOVER_CONFIG: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
for dev in devices_not_created:
|
for dev in devices_not_created:
|
||||||
if dev in HOMEMATIC_DEVICES:
|
if dev in HOMEMATIC_DEVICES:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user