mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Update mypy-dev to 1.12.0a2 (#122613)
This commit is contained in:
parent
d77b5cbbbf
commit
e5f2046b19
@ -6,7 +6,7 @@ from collections.abc import Callable, Coroutine
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from hass_nabucasa.voice import MAP_VOICE
|
from hass_nabucasa.voice import MAP_VOICE, Gender
|
||||||
|
|
||||||
from homeassistant.auth.const import GROUP_ID_ADMIN
|
from homeassistant.auth.const import GROUP_ID_ADMIN
|
||||||
from homeassistant.auth.models import User
|
from homeassistant.auth.models import User
|
||||||
@ -91,8 +91,8 @@ class CloudPreferencesStore(Store):
|
|||||||
# The new second item is the voice name.
|
# The new second item is the voice name.
|
||||||
default_tts_voice = old_data.get(PREF_TTS_DEFAULT_VOICE)
|
default_tts_voice = old_data.get(PREF_TTS_DEFAULT_VOICE)
|
||||||
if default_tts_voice and (voice_item_two := default_tts_voice[1]) in (
|
if default_tts_voice and (voice_item_two := default_tts_voice[1]) in (
|
||||||
"female",
|
Gender.FEMALE,
|
||||||
"male",
|
Gender.MALE,
|
||||||
):
|
):
|
||||||
language: str = default_tts_voice[0]
|
language: str = default_tts_voice[0]
|
||||||
if voice := MAP_VOICE.get((language, voice_item_two)):
|
if voice := MAP_VOICE.get((language, voice_item_two)):
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import cast
|
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -15,7 +13,6 @@ from .climate_entities import (
|
|||||||
WIDGET_AND_CONTROLLABLE_TO_CLIMATE_ENTITY,
|
WIDGET_AND_CONTROLLABLE_TO_CLIMATE_ENTITY,
|
||||||
WIDGET_AND_PROTOCOL_TO_CLIMATE_ENTITY,
|
WIDGET_AND_PROTOCOL_TO_CLIMATE_ENTITY,
|
||||||
WIDGET_TO_CLIMATE_ENTITY,
|
WIDGET_TO_CLIMATE_ENTITY,
|
||||||
Controllable,
|
|
||||||
)
|
)
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
@ -39,7 +36,7 @@ async def async_setup_entry(
|
|||||||
# ie Atlantic APC
|
# ie Atlantic APC
|
||||||
entities_based_on_widget_and_controllable: list[Entity] = [
|
entities_based_on_widget_and_controllable: list[Entity] = [
|
||||||
WIDGET_AND_CONTROLLABLE_TO_CLIMATE_ENTITY[device.widget][
|
WIDGET_AND_CONTROLLABLE_TO_CLIMATE_ENTITY[device.widget][
|
||||||
cast(Controllable, device.controllable_name)
|
device.controllable_name
|
||||||
](device.device_url, data.coordinator)
|
](device.device_url, data.coordinator)
|
||||||
for device in data.platforms[Platform.CLIMATE]
|
for device in data.platforms[Platform.CLIMATE]
|
||||||
if device.widget in WIDGET_AND_CONTROLLABLE_TO_CLIMATE_ENTITY
|
if device.widget in WIDGET_AND_CONTROLLABLE_TO_CLIMATE_ENTITY
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
from typing import Any, Literal
|
from typing import Any, Final
|
||||||
|
|
||||||
import transmission_rpc
|
import transmission_rpc
|
||||||
from transmission_rpc.error import (
|
from transmission_rpc.error import (
|
||||||
@ -278,8 +278,7 @@ async def get_api(
|
|||||||
hass: HomeAssistant, entry: dict[str, Any]
|
hass: HomeAssistant, entry: dict[str, Any]
|
||||||
) -> transmission_rpc.Client:
|
) -> transmission_rpc.Client:
|
||||||
"""Get Transmission client."""
|
"""Get Transmission client."""
|
||||||
protocol: Literal["http", "https"]
|
protocol: Final = "https" if entry[CONF_SSL] else "http"
|
||||||
protocol = "https" if entry[CONF_SSL] else "http"
|
|
||||||
host = entry[CONF_HOST]
|
host = entry[CONF_HOST]
|
||||||
port = entry[CONF_PORT]
|
port = entry[CONF_PORT]
|
||||||
path = entry[CONF_PATH]
|
path = entry[CONF_PATH]
|
||||||
|
@ -11,7 +11,7 @@ astroid==3.2.4
|
|||||||
coverage==7.6.0
|
coverage==7.6.0
|
||||||
freezegun==1.5.1
|
freezegun==1.5.1
|
||||||
mock-open==1.4.0
|
mock-open==1.4.0
|
||||||
mypy-dev==1.12.0a1
|
mypy-dev==1.12.0a2
|
||||||
pre-commit==3.7.1
|
pre-commit==3.7.1
|
||||||
pydantic==1.10.17
|
pydantic==1.10.17
|
||||||
pylint==3.2.6
|
pylint==3.2.6
|
||||||
|
Loading…
x
Reference in New Issue
Block a user