Improve humidifier type hints in integrations (#90030)

Fix humidifier type hints in integrations
This commit is contained in:
epenet 2023-03-21 10:32:13 +01:00 committed by GitHub
parent 292feb4e24
commit 04872f72ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -436,7 +436,7 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
data = {ATTR_ENTITY_ID: self._switch_entity_id}
await self.hass.services.async_call(HA_DOMAIN, SERVICE_TURN_OFF, data)
async def async_set_mode(self, mode: str):
async def async_set_mode(self, mode: str) -> None:
"""Set new mode.
This method must be run in the event loop and returns a coroutine.

View File

@ -1,6 +1,7 @@
"""Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier with humidifier entity."""
import logging
import math
from typing import Any
from miio.integrations.humidifier.deerma.airhumidifier_mjjsq import (
OperationMode as AirhumidifierMjjsqOperationMode,
@ -136,10 +137,7 @@ class XiaomiGenericHumidifier(XiaomiCoordinatedMiioEntity, HumidifierEntity):
"""Get the current mode."""
return self._mode
async def async_turn_on(
self,
**kwargs,
) -> None:
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the device on."""
result = await self._try_command(
"Turning the miio device on failed.", self._device.on
@ -148,7 +146,7 @@ class XiaomiGenericHumidifier(XiaomiCoordinatedMiioEntity, HumidifierEntity):
self._state = True
self.async_write_ha_state()
async def async_turn_off(self, **kwargs) -> None:
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the device off."""
result = await self._try_command(
"Turning the miio device off failed.", self._device.off