Enable basic type checking in demo init (#66218)

* Enable basic type checking in demo init

* Remove from mypy ignore list
This commit is contained in:
epenet 2022-02-10 09:04:36 +01:00 committed by GitHub
parent e90143e5c9
commit f17d66228c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 12 deletions

View file

@ -3,7 +3,7 @@ import asyncio
import datetime import datetime
from random import random from random import random
from homeassistant import bootstrap, config_entries from homeassistant import config_entries, setup
from homeassistant.components import persistent_notification from homeassistant.components import persistent_notification
from homeassistant.components.recorder.statistics import ( from homeassistant.components.recorder.statistics import (
async_add_external_statistics, async_add_external_statistics,
@ -83,11 +83,11 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
if not hass.config.longitude: if not hass.config.longitude:
hass.config.longitude = 117.22743 hass.config.longitude = 117.22743
tasks = [bootstrap.async_setup_component(hass, "sun", config)] tasks = [setup.async_setup_component(hass, "sun", config)]
# Set up input select # Set up input select
tasks.append( tasks.append(
bootstrap.async_setup_component( setup.async_setup_component(
hass, hass,
"input_select", "input_select",
{ {
@ -108,7 +108,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
# Set up input boolean # Set up input boolean
tasks.append( tasks.append(
bootstrap.async_setup_component( setup.async_setup_component(
hass, hass,
"input_boolean", "input_boolean",
{ {
@ -125,7 +125,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
# Set up input button # Set up input button
tasks.append( tasks.append(
bootstrap.async_setup_component( setup.async_setup_component(
hass, hass,
"input_button", "input_button",
{ {
@ -141,7 +141,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
# Set up input number # Set up input number
tasks.append( tasks.append(
bootstrap.async_setup_component( setup.async_setup_component(
hass, hass,
"input_number", "input_number",
{ {
@ -280,7 +280,7 @@ async def finish_setup(hass, config):
lights = sorted(hass.states.async_entity_ids("light")) lights = sorted(hass.states.async_entity_ids("light"))
# Set up scripts # Set up scripts
await bootstrap.async_setup_component( await setup.async_setup_component(
hass, hass,
"script", "script",
{ {
@ -309,7 +309,7 @@ async def finish_setup(hass, config):
) )
# Set up scenes # Set up scenes
await bootstrap.async_setup_component( await setup.async_setup_component(
hass, hass,
"scene", "scene",
{ {

View file

@ -2196,9 +2196,6 @@ ignore_errors = true
[mypy-homeassistant.components.deconz.switch] [mypy-homeassistant.components.deconz.switch]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.demo]
ignore_errors = true
[mypy-homeassistant.components.demo.fan] [mypy-homeassistant.components.demo.fan]
ignore_errors = true ignore_errors = true

View file

@ -38,7 +38,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.deconz.services", "homeassistant.components.deconz.services",
"homeassistant.components.deconz.siren", "homeassistant.components.deconz.siren",
"homeassistant.components.deconz.switch", "homeassistant.components.deconz.switch",
"homeassistant.components.demo",
"homeassistant.components.demo.fan", "homeassistant.components.demo.fan",
"homeassistant.components.demo.light", "homeassistant.components.demo.light",
"homeassistant.components.demo.number", "homeassistant.components.demo.number",