Enable strict typing for config (#108023)
This commit is contained in:
parent
26cc6a5bb4
commit
afcb7a26cd
13 changed files with 178 additions and 76 deletions
|
@ -1,7 +1,9 @@
|
|||
"""Component to interact with Hassbian tools."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from aiohttp import web
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import websocket_api
|
||||
|
@ -13,7 +15,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
|||
from homeassistant.util import location, unit_system
|
||||
|
||||
|
||||
async def async_setup(hass):
|
||||
async def async_setup(hass: HomeAssistant) -> bool:
|
||||
"""Set up the Hassbian config."""
|
||||
hass.http.register_view(CheckConfigView)
|
||||
websocket_api.async_register_command(hass, websocket_update_config)
|
||||
|
@ -28,7 +30,7 @@ class CheckConfigView(HomeAssistantView):
|
|||
name = "api:config:core:check_config"
|
||||
|
||||
@require_admin
|
||||
async def post(self, request):
|
||||
async def post(self, request: web.Request) -> web.Response:
|
||||
"""Validate configuration and return results."""
|
||||
|
||||
res = await check_config.async_check_ha_config_file(request.app["hass"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue