Skip to content

Commit

Permalink
chore: add missing typing (#302)
Browse files Browse the repository at this point in the history
* chore: add missing typing

* chore: few more typing
  • Loading branch information
chemelli74 authored Sep 7, 2024
1 parent 56b6cde commit c4459a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/midea_ac_lan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType
from midealocal.device import DeviceType, ProtocolVersion
from midealocal.device import DeviceType, MideaDevice, ProtocolVersion
from midealocal.devices import device_selector

from .const import (
Expand Down Expand Up @@ -63,11 +63,11 @@ async def update_listener(hass: HomeAssistant, config_entry: ConfigEntry) -> Non
hass.async_create_task(
hass.config_entries.async_forward_entry_setups(config_entry, ALL_PLATFORM),
)
device_id = config_entry.data.get(CONF_DEVICE_ID)
device_id: int = cast(int, config_entry.data.get(CONF_DEVICE_ID))
customize = config_entry.options.get(CONF_CUSTOMIZE, "")
ip_address = config_entry.options.get(CONF_IP_ADDRESS, None)
refresh_interval = config_entry.options.get(CONF_REFRESH_INTERVAL, None)
dev = hass.data[DOMAIN][DEVICES].get(device_id)
dev: MideaDevice = hass.data[DOMAIN][DEVICES].get(device_id)
if dev:
dev.set_customize(customize)
if ip_address is not None:
Expand Down Expand Up @@ -99,10 +99,10 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa:

def service_set_attribute(service: Any) -> None: # noqa: ANN401
"""Set service attribute func."""
device_id = service.data["device_id"]
device_id: int = service.data["device_id"]
attr = service.data["attribute"]
value = service.data["value"]
dev = hass.data[DOMAIN][DEVICES].get(device_id)
dev: MideaDevice = hass.data[DOMAIN][DEVICES].get(device_id)
if dev:
if attr == "fan_speed" and value == "auto":
value = 102
Expand Down

0 comments on commit c4459a3

Please sign in to comment.