mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Reload groups (#3203)
* Allow reloading groups without restart * Test to make sure automation listeners are removed. * Remove unused imports for group tests * Simplify group config validation * Add prepare_reload function to entity component * Migrate group to use entity_component.prepare_reload * Migrate automation to use entity_component.prepare_reload * Clean up group.get_entity_ids * Use cv.boolean for group config validation
This commit is contained in:
@@ -6,11 +6,11 @@ import logging
|
||||
import jinja2
|
||||
from jinja2.sandbox import ImmutableSandboxedEnvironment
|
||||
|
||||
from homeassistant.components import group
|
||||
from homeassistant.const import STATE_UNKNOWN, ATTR_LATITUDE, ATTR_LONGITUDE
|
||||
from homeassistant.core import State
|
||||
from homeassistant.exceptions import TemplateError
|
||||
from homeassistant.helpers import location as loc_helper
|
||||
from homeassistant.loader import get_component
|
||||
from homeassistant.util import convert, dt as dt_util, location as loc_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -169,6 +169,8 @@ class LocationMethods(object):
|
||||
else:
|
||||
gr_entity_id = str(entities)
|
||||
|
||||
group = get_component('group')
|
||||
|
||||
states = [self._hass.states.get(entity_id) for entity_id
|
||||
in group.expand_entity_ids(self._hass, [gr_entity_id])]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user