mirror of
https://github.com/home-assistant/core.git
synced 2025-11-15 22:10:09 +00:00
Fix bad falsy-check in homeassistant.set_location service (#129389)
This commit is contained in:
@@ -242,7 +242,7 @@ async def test_setting_location(hass: HomeAssistant) -> None:
|
||||
assert elevation != 50
|
||||
await hass.services.async_call(
|
||||
"homeassistant",
|
||||
"set_location",
|
||||
SERVICE_SET_LOCATION,
|
||||
{"latitude": 30, "longitude": 40},
|
||||
blocking=True,
|
||||
)
|
||||
@@ -253,12 +253,24 @@ async def test_setting_location(hass: HomeAssistant) -> None:
|
||||
|
||||
await hass.services.async_call(
|
||||
"homeassistant",
|
||||
"set_location",
|
||||
SERVICE_SET_LOCATION,
|
||||
{"latitude": 30, "longitude": 40, "elevation": 50},
|
||||
blocking=True,
|
||||
)
|
||||
assert hass.config.latitude == 30
|
||||
assert hass.config.longitude == 40
|
||||
assert hass.config.elevation == 50
|
||||
|
||||
await hass.services.async_call(
|
||||
"homeassistant",
|
||||
SERVICE_SET_LOCATION,
|
||||
{"latitude": 30, "longitude": 40, "elevation": 0},
|
||||
blocking=True,
|
||||
)
|
||||
assert hass.config.latitude == 30
|
||||
assert hass.config.longitude == 40
|
||||
assert hass.config.elevation == 0
|
||||
|
||||
|
||||
async def test_require_admin(
|
||||
hass: HomeAssistant, hass_read_only_user: MockUser
|
||||
|
||||
Reference in New Issue
Block a user