From 20126363f2cb8c2166d6b0ff641e286df87e76d3 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 5 Apr 2022 10:28:52 +0200 Subject: [PATCH] Add basic type hints to vulcan (#69321) --- homeassistant/components/vulcan/__init__.py | 2 +- homeassistant/components/vulcan/calendar.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/vulcan/__init__.py b/homeassistant/components/vulcan/__init__.py index 37210778b1c..430819c8f4c 100644 --- a/homeassistant/components/vulcan/__init__.py +++ b/homeassistant/components/vulcan/__init__.py @@ -61,7 +61,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: return True -async def async_unload_entry(hass, entry): +async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" await hass.data[DOMAIN][entry.entry_id].close() for platform in PLATFORMS: diff --git a/homeassistant/components/vulcan/calendar.py b/homeassistant/components/vulcan/calendar.py index 9c853b03197..2e9e79063f9 100644 --- a/homeassistant/components/vulcan/calendar.py +++ b/homeassistant/components/vulcan/calendar.py @@ -7,10 +7,13 @@ from aiohttp import ClientConnectorError from vulcan._utils import VulcanAPIException from homeassistant.components.calendar import ENTITY_ID_FORMAT, CalendarEventDevice +from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SCAN_INTERVAL +from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryAuthFailed from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.entity import generate_entity_id +from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.template import DATE_STR_FORMAT from homeassistant.util import Throttle, dt @@ -21,7 +24,11 @@ from .fetch_data import get_lessons, get_student_info _LOGGER = logging.getLogger(__name__) -async def async_setup_entry(hass, config_entry, async_add_entities): +async def async_setup_entry( + hass: HomeAssistant, + config_entry: ConfigEntry, + async_add_entities: AddEntitiesCallback, +) -> None: """Set up the calendar platform for event devices.""" VulcanCalendarData.MIN_TIME_BETWEEN_UPDATES = timedelta( minutes=config_entry.options.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL)