mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 14:15:12 +02:00
Lint fixes
This commit is contained in:
@@ -156,12 +156,12 @@ class LocationMethods(object):
|
|||||||
states = list(entities)
|
states = list(entities)
|
||||||
else:
|
else:
|
||||||
if isinstance(entities, State):
|
if isinstance(entities, State):
|
||||||
entity_id = entities.entity_id
|
gr_entity_id = entities.entity_id
|
||||||
else:
|
else:
|
||||||
entity_id = str(entities)
|
gr_entity_id = str(entities)
|
||||||
|
|
||||||
states = [self._hass.states.get(entity_id) for entity_id
|
states = [self._hass.states.get(entity_id) for entity_id
|
||||||
in group.expand_entity_ids(self._hass, [entity_id])]
|
in group.expand_entity_ids(self._hass, [gr_entity_id])]
|
||||||
|
|
||||||
return loc_helper.closest(latitude, longitude, states)
|
return loc_helper.closest(latitude, longitude, states)
|
||||||
|
|
||||||
|
@@ -292,7 +292,6 @@ class TestUtilTemplate(unittest.TestCase):
|
|||||||
self.hass,
|
self.hass,
|
||||||
'{{ distance("123", states.test_object_2) }}'))
|
'{{ distance("123", states.test_object_2) }}'))
|
||||||
|
|
||||||
|
|
||||||
def test_closest_function_home_vs_domain(self):
|
def test_closest_function_home_vs_domain(self):
|
||||||
self.hass.states.set('test_domain.object', 'happy', {
|
self.hass.states.set('test_domain.object', 'happy', {
|
||||||
'latitude': self.hass.config.latitude + 0.1,
|
'latitude': self.hass.config.latitude + 0.1,
|
||||||
|
Reference in New Issue
Block a user