Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ homeassistant.components.clicksend.*
homeassistant.components.climate.*
homeassistant.components.cloud.*
homeassistant.components.co2signal.*
homeassistant.components.collection_image.*
homeassistant.components.comelit.*
homeassistant.components.command_line.*
homeassistant.components.compit.*
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/air_quality/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "air_quality",
"name": "Air Quality",
"name": "Air quality",
"codeowners": ["@home-assistant/core"],
"documentation": "https://www.home-assistant.io/integrations/air_quality",
"integration_type": "entity",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/air_quality/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"name": "Volatile organic compounds value"
}
},
"title": "Air Quality",
"title": "Air quality",
"triggers": {
"co2_changed": {
"description": "Triggers when one or more carbon dioxide levels change.",
Expand Down
17 changes: 4 additions & 13 deletions homeassistant/components/aladdin_connect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
config_entry_oauth2_flow,
device_registry as dr,
)
from homeassistant.helpers.config_entry_oauth2_flow import (
ImplementationUnavailableError,
)

from . import api
from .const import CONFIG_FLOW_MINOR_VERSION, CONFIG_FLOW_VERSION, DOMAIN
Expand All @@ -31,17 +28,11 @@ async def async_setup_entry(
hass: HomeAssistant, entry: AladdinConnectConfigEntry
) -> bool:
"""Set up Aladdin Connect Genie from a config entry."""
try:
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
except ImplementationUnavailableError as err:
raise ConfigEntryNotReady(
translation_domain=DOMAIN,
translation_key="oauth2_implementation_unavailable",
) from err
)

session = config_entry_oauth2_flow.OAuth2Session(hass, entry, implementation)

Expand Down
3 changes: 0 additions & 3 deletions homeassistant/components/aladdin_connect/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
"close_door_failed": {
"message": "Failed to close the garage door"
},
"oauth2_implementation_unavailable": {
"message": "[%key:common::exceptions::oauth2_implementation_unavailable::message%]"
},
"open_door_failed": {
"message": "Failed to open the garage door"
}
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/alarm_control_panel/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "alarm_control_panel",
"name": "Alarm Control Panel",
"name": "Alarm control panel",
"codeowners": ["@home-assistant/core"],
"documentation": "https://www.home-assistant.io/integrations/alarm_control_panel",
"integration_type": "entity",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "application_credentials",
"name": "Application Credentials",
"name": "Application credentials",
"codeowners": ["@home-assistant/core"],
"config_flow": false,
"dependencies": ["auth", "websocket_api"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"title": "Application Credentials"
"title": "Application credentials"
}
6 changes: 1 addition & 5 deletions homeassistant/components/august/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
from homeassistant.helpers import device_registry as dr, issue_registry as ir
from homeassistant.helpers.config_entry_oauth2_flow import (
ImplementationUnavailableError,
OAuth2Session,
async_get_config_entry_implementation,
)
Expand All @@ -40,10 +39,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: AugustConfigEntry) -> bo
raise ConfigEntryAuthFailed("Migration to OAuth required")

session = async_create_august_clientsession(hass)
try:
implementation = await async_get_config_entry_implementation(hass, entry)
except ImplementationUnavailableError as err:
raise ConfigEntryNotReady("OAuth implementation not available") from err
implementation = await async_get_config_entry_implementation(hass, entry)
oauth_session = OAuth2Session(hass, entry, implementation)
august_gateway = AugustGateway(Path(hass.config.config_dir), session, oauth_session)
try:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/binary_sensor/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "binary_sensor",
"name": "Binary Sensor",
"name": "Binary sensor",
"codeowners": ["@home-assistant/core"],
"documentation": "https://www.home-assistant.io/integrations/binary_sensor",
"integration_type": "entity",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/collection_image/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def get_random_image(self) -> None:
self._attr_available = True
await self.update_image(child.media_content_id)

async def update_image(self, image_id: str):
async def update_image(self, image_id: str) -> None:
"""Update the entity from the image_id."""
self._cached_image = None
try:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/collection_image/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "collection_image",
"name": "Collection Image",
"name": "Collection image",
"codeowners": ["@karwosts"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/collection_image",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ rules:
inject-websession:
status: exempt
comment: No external connections.
strict-typing: todo
strict-typing: done
2 changes: 1 addition & 1 deletion homeassistant/components/collection_image/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
"name": "Shuffle"
}
},
"title": "Collection Image"
"title": "Collection image"
}
2 changes: 1 addition & 1 deletion homeassistant/components/command_line/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "command_line",
"name": "Command Line",
"name": "Command line",
"codeowners": ["@gjohansson-ST"],
"documentation": "https://www.home-assistant.io/integrations/command_line",
"iot_class": "local_polling",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/device_automation/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "device_automation",
"name": "Device Automation",
"name": "Device automation",
"codeowners": ["@home-assistant/core"],
"documentation": "https://www.home-assistant.io/integrations/device_automation",
"integration_type": "system",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "device_sun_light_trigger",
"name": "Presence-based Lights",
"name": "Presence-based lights",
"after_dependencies": ["device_tracker", "group", "light", "person"],
"codeowners": [],
"documentation": "https://www.home-assistant.io/integrations/device_sun_light_trigger",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/device_tracker/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "device_tracker",
"name": "Device Tracker",
"name": "Device tracker",
"codeowners": ["@home-assistant/core"],
"dependencies": ["zone"],
"documentation": "https://www.home-assistant.io/integrations/device_tracker",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/dhcp/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "dhcp",
"name": "DHCP Discovery",
"name": "DHCP discovery",
"codeowners": ["@bdraco"],
"dependencies": ["network"],
"documentation": "https://www.home-assistant.io/integrations/dhcp",
Expand Down
9 changes: 1 addition & 8 deletions homeassistant/components/dropbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.config_entry_oauth2_flow import (
ImplementationUnavailableError,
OAuth2Session,
async_get_config_entry_implementation,
)
Expand All @@ -24,13 +23,7 @@

async def async_setup_entry(hass: HomeAssistant, entry: DropboxConfigEntry) -> bool:
"""Set up Dropbox from a config entry."""
try:
oauth2_implementation = await async_get_config_entry_implementation(hass, entry)
except ImplementationUnavailableError as err:
raise ConfigEntryNotReady(
translation_domain=DOMAIN,
translation_key="oauth2_implementation_unavailable",
) from err
oauth2_implementation = await async_get_config_entry_implementation(hass, entry)

token = entry.data["token"]
if not set(token.get("scope", "").split()).issuperset(OAUTH2_SCOPES):
Expand Down
3 changes: 0 additions & 3 deletions homeassistant/components/dropbox/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
},
"missing_scopes": {
"message": "[%key:component::dropbox::config::step::reauth_permissions::description%]"
},
"oauth2_implementation_unavailable": {
"message": "[%key:common::exceptions::oauth2_implementation_unavailable::message%]"
}
}
}
2 changes: 1 addition & 1 deletion homeassistant/components/file_upload/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "file_upload",
"name": "File Upload",
"name": "File upload",
"codeowners": ["@home-assistant/core"],
"dependencies": ["http"],
"documentation": "https://www.home-assistant.io/integrations/file_upload",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/filesize/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "filesize",
"name": "File Size",
"name": "File size",
"codeowners": ["@gjohansson-ST"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/filesize",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/filesize/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
}
}
},
"title": "Filesize"
"title": "File size"
}
19 changes: 5 additions & 14 deletions homeassistant/components/fitbit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import config_entry_oauth2_flow
from homeassistant.helpers.config_entry_oauth2_flow import (
ImplementationUnavailableError,
)

from . import api
from .const import DOMAIN, FitbitScope
from .const import FitbitScope
from .coordinator import FitbitConfigEntry, FitbitData, FitbitDeviceCoordinator
from .exceptions import FitbitApiException, FitbitAuthException
from .model import config_from_entry_data
Expand All @@ -19,17 +16,11 @@

async def async_setup_entry(hass: HomeAssistant, entry: FitbitConfigEntry) -> bool:
"""Set up fitbit from a config entry."""
try:
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
except ImplementationUnavailableError as err:
raise ConfigEntryNotReady(
translation_domain=DOMAIN,
translation_key="oauth2_implementation_unavailable",
) from err
)
session = config_entry_oauth2_flow.OAuth2Session(hass, entry, implementation)
fitbit_api = api.OAuthFitbitApi(
hass, session, unit_system=entry.data.get("unit_system")
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/fitbit/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,5 @@
"name": "Water"
}
}
},
"exceptions": {
"oauth2_implementation_unavailable": {
"message": "[%key:common::exceptions::oauth2_implementation_unavailable::message%]"
}
}
}
2 changes: 1 addition & 1 deletion homeassistant/components/folder_watcher/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "folder_watcher",
"name": "Folder Watcher",
"name": "Folder watcher",
"codeowners": [],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/folder_watcher",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "frontend",
"name": "Home Assistant Frontend",
"name": "Home Assistant frontend",
"codeowners": ["@home-assistant/frontend"],
"dependencies": [
"api",
Expand Down
16 changes: 5 additions & 11 deletions homeassistant/components/gentex_homelink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from homeassistant.const import EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers import aiohttp_client, config_entry_oauth2_flow

from . import oauth2
Expand All @@ -27,17 +27,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: HomeLinkConfigEntry) ->
hass, DOMAIN, auth_implementation
)

try:
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
except config_entry_oauth2_flow.ImplementationUnavailableError as err:
raise ConfigEntryNotReady(
translation_domain=DOMAIN,
translation_key="oauth2_implementation_unavailable",
) from err
)

session = config_entry_oauth2_flow.OAuth2Session(hass, entry, implementation)
authenticated_session = oauth2.AsyncConfigEntryAuth(
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/gentex_homelink/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,5 @@
}
}
}
},
"exceptions": {
"oauth2_implementation_unavailable": {
"message": "[%key:common::exceptions::oauth2_implementation_unavailable::message%]"
}
}
}
11 changes: 1 addition & 10 deletions homeassistant/components/geocaching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,19 @@

from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.config_entry_oauth2_flow import (
ImplementationUnavailableError,
OAuth2Session,
async_get_config_entry_implementation,
)

from .const import DOMAIN
from .coordinator import GeocachingConfigEntry, GeocachingDataUpdateCoordinator

PLATFORMS = [Platform.SENSOR]


async def async_setup_entry(hass: HomeAssistant, entry: GeocachingConfigEntry) -> bool:
"""Set up Geocaching from a config entry."""
try:
implementation = await async_get_config_entry_implementation(hass, entry)
except ImplementationUnavailableError as err:
raise ConfigEntryNotReady(
translation_domain=DOMAIN,
translation_key="oauth2_implementation_unavailable",
) from err
implementation = await async_get_config_entry_implementation(hass, entry)

oauth_session = OAuth2Session(hass, entry, implementation)
coordinator = GeocachingDataUpdateCoordinator(
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/geocaching/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,5 @@
"unit_of_measurement": "souvenirs"
}
}
},
"exceptions": {
"oauth2_implementation_unavailable": {
"message": "[%key:common::exceptions::oauth2_implementation_unavailable::message%]"
}
}
}
Loading
Loading