Fix core config schema "elevation" validation (#175692)

This commit is contained in:
Tom Carpenter
2026-07-08 22:49:32 +02:00
committed by GitHub
parent 1d0c72e0d9
commit 0a612932ea
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ class CheckConfigView(HomeAssistantView):
"type": "config/core/update",
vol.Optional("country"): cv.country,
vol.Optional("currency"): cv.currency,
vol.Optional("elevation"): int,
vol.Optional("elevation"): vol.Coerce(int),
vol.Optional("external_url"): vol.Any(cv.url_no_path, None),
vol.Optional("internal_url"): vol.Any(cv.url_no_path, None),
vol.Optional("language"): cv.language,
@@ -324,7 +324,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa:
{
vol.Required(ATTR_LATITUDE): cv.latitude,
vol.Required(ATTR_LONGITUDE): cv.longitude,
vol.Optional(ATTR_ELEVATION): int,
vol.Optional(ATTR_ELEVATION): vol.Coerce(int),
}
),
)
+1 -1
View File
@@ -134,7 +134,7 @@ async def test_websocket_core_update(hass: HomeAssistant, client) -> None:
"type": "config/core/update",
"latitude": 60,
"longitude": 50,
"elevation": 25,
"elevation": 25.6,
"location_name": "Huis",
"unit_system": "imperial",
"time_zone": "America/New_York",
+1 -1
View File
@@ -291,7 +291,7 @@ async def test_setting_location(hass: HomeAssistant) -> None:
await hass.services.async_call(
DOMAIN,
SERVICE_SET_LOCATION,
{"latitude": 30, "longitude": 40, "elevation": 0},
{"latitude": 30, "longitude": 40, "elevation": 0.6},
blocking=True,
)
assert hass.config.latitude == 30