Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Caius-Bonus authored Aug 11, 2023
2 parents 64e4530 + 58194a5 commit d053470
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/met_eireann/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""The met_eireann component."""
from datetime import timedelta
import logging
from typing import Self

import meteireann

Expand Down Expand Up @@ -33,7 +34,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b

weather_data = MetEireannWeatherData(hass, config_entry.data, raw_weather_data)

async def _async_update_data():
async def _async_update_data() -> MetEireannWeatherData:
"""Fetch data from Met Éireann."""
try:
return await weather_data.fetch_data()
Expand Down Expand Up @@ -78,7 +79,7 @@ def __init__(self, hass, config, weather_data):
self.daily_forecast = None
self.hourly_forecast = None

async def fetch_data(self):
async def fetch_data(self) -> Self:
"""Fetch data from API - (current weather and forecast)."""
await self._weather_data.fetching_data()
self.current_weather_data = self._weather_data.get_current_weather()
Expand Down
10 changes: 8 additions & 2 deletions homeassistant/components/met_eireann/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
)
from homeassistant.util import dt as dt_util

from . import MetEireannWeatherData
from .const import CONDITION_MAP, DEFAULT_NAME, DOMAIN, FORECAST_MAP

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -54,7 +58,9 @@ async def async_setup_entry(
)


class MetEireannWeather(CoordinatorEntity, WeatherEntity):
class MetEireannWeather(
CoordinatorEntity[DataUpdateCoordinator[MetEireannWeatherData]], WeatherEntity
):
"""Implementation of a Met Éireann weather condition."""

_attr_attribution = "Data provided by Met Éireann"
Expand Down
3 changes: 1 addition & 2 deletions homeassistant/components/stream/recorder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Provide functionality to record stream."""
from __future__ import annotations

from collections import deque
from io import DEFAULT_BUFFER_SIZE, BytesIO
import logging
import os
Expand All @@ -19,8 +20,6 @@
from .fmp4utils import read_init, transform_init

if TYPE_CHECKING:
import deque

from homeassistant.components.camera import DynamicStreamSettings

_LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/wake_word/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def async_get_wake_word_detection_entity(
hass: HomeAssistant, entity_id: str
) -> WakeWordDetectionEntity | None:
"""Return wake word entity."""
component: EntityComponent = hass.data[DOMAIN]
component: EntityComponent[WakeWordDetectionEntity] = hass.data[DOMAIN]

return component.get_entity(entity_id)

Expand Down

0 comments on commit d053470

Please sign in to comment.