mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Update home zone when core config updated (#24237)
* Update home zone when core config updated * Lint
This commit is contained in:
@@ -221,3 +221,24 @@ class TestComponentZone(unittest.TestCase):
|
||||
|
||||
assert zone.zone.in_zone(self.hass.states.get('zone.passive_zone'),
|
||||
latitude, longitude)
|
||||
|
||||
|
||||
async def test_core_config_update(hass):
|
||||
"""Test updating core config will update home zone."""
|
||||
assert await setup.async_setup_component(hass, 'zone', {})
|
||||
|
||||
home = hass.states.get('zone.home')
|
||||
|
||||
await hass.config.async_update(
|
||||
location_name='Updated Name',
|
||||
latitude=10,
|
||||
longitude=20,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
home_updated = hass.states.get('zone.home')
|
||||
|
||||
assert home is not home_updated
|
||||
assert home_updated.name == 'Updated Name'
|
||||
assert home_updated.attributes['latitude'] == 10
|
||||
assert home_updated.attributes['longitude'] == 20
|
||||
|
||||
Reference in New Issue
Block a user