mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Cleanup some typing in isy994 (#141859)
Now that pyisy is mostly typed there were some obvious issues. We are still a long way away from being able to add py.typed to pyisy, but we can now see some obvious things in an IDE
This commit is contained in:
parent
02397a8d2d
commit
b5e1f7e03e
@ -227,9 +227,9 @@ async def async_unload_entry(
|
||||
"""Unload a config entry."""
|
||||
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||
|
||||
isy_data = hass.data[DOMAIN][entry.entry_id]
|
||||
isy_data: IsyData = hass.data[DOMAIN][entry.entry_id]
|
||||
|
||||
isy: ISY = isy_data.root
|
||||
isy = isy_data.root
|
||||
|
||||
_LOGGER.debug("ISY Stopping Event Stream and automatic updates")
|
||||
isy.websocket.stop()
|
||||
|
@ -181,6 +181,7 @@ class ISYProgramEntity(ISYEntity):
|
||||
|
||||
_actions: Program
|
||||
_status: Program
|
||||
_node: Program
|
||||
|
||||
def __init__(self, name: str, status: Program, actions: Program = None) -> None:
|
||||
"""Initialize the ISY program-based entity."""
|
||||
|
@ -21,6 +21,7 @@ from homeassistant.helpers.service import entity_service_call
|
||||
from homeassistant.helpers.typing import VolDictType
|
||||
|
||||
from .const import _LOGGER, DOMAIN
|
||||
from .models import IsyData
|
||||
|
||||
# Common Services for All Platforms:
|
||||
SERVICE_SEND_PROGRAM_COMMAND = "send_program_command"
|
||||
@ -149,7 +150,7 @@ def async_setup_services(hass: HomeAssistant) -> None:
|
||||
isy_name = service.data.get(CONF_ISY)
|
||||
|
||||
for config_entry_id in hass.data[DOMAIN]:
|
||||
isy_data = hass.data[DOMAIN][config_entry_id]
|
||||
isy_data: IsyData = hass.data[DOMAIN][config_entry_id]
|
||||
isy = isy_data.root
|
||||
if isy_name and isy_name != isy.conf["name"]:
|
||||
continue
|
||||
|
@ -157,7 +157,7 @@ class ISYEnableSwitchEntity(ISYAuxControlEntity, SwitchEntity):
|
||||
device_info=device_info,
|
||||
)
|
||||
self._attr_name = description.name # Override super
|
||||
self._change_handler: EventListener = None
|
||||
self._change_handler: EventListener | None = None
|
||||
|
||||
# pylint: disable-next=hass-missing-super-call
|
||||
async def async_added_to_hass(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user