mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Merge pull request #10060 from home-assistant/some-cleanups
Remove warning component / Update event trigger for UI created
This commit is contained in:
commit
5182f76aea
@ -31,7 +31,7 @@ def async_trigger(hass, config, action):
|
|||||||
event_type = config.get(CONF_EVENT_TYPE)
|
event_type = config.get(CONF_EVENT_TYPE)
|
||||||
event_data_schema = vol.Schema(
|
event_data_schema = vol.Schema(
|
||||||
config.get(CONF_EVENT_DATA),
|
config.get(CONF_EVENT_DATA),
|
||||||
extra=vol.ALLOW_EXTRA) if CONF_EVENT_DATA in config else None
|
extra=vol.ALLOW_EXTRA) if config.get(CONF_EVENT_DATA) else None
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def handle_event(event):
|
def handle_event(event):
|
||||||
|
@ -370,12 +370,6 @@ class EntityPlatform(object):
|
|||||||
|
|
||||||
def add_entities(self, new_entities, update_before_add=False):
|
def add_entities(self, new_entities, update_before_add=False):
|
||||||
"""Add entities for a single platform."""
|
"""Add entities for a single platform."""
|
||||||
# That avoid deadlocks
|
|
||||||
if update_before_add:
|
|
||||||
self.component.logger.warning(
|
|
||||||
"Call 'add_entities' with update_before_add=True "
|
|
||||||
"only inside tests or you can run into a deadlock!")
|
|
||||||
|
|
||||||
run_coroutine_threadsafe(
|
run_coroutine_threadsafe(
|
||||||
self.async_add_entities(list(new_entities), update_before_add),
|
self.async_add_entities(list(new_entities), update_before_add),
|
||||||
self.component.hass.loop).result()
|
self.component.hass.loop).result()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user