mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Fix core config schema "elevation" validation (#175692)
This commit is contained in:
@@ -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),
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user