Add missing return type in test __init__ method (part 4) (#123947)

pull/123995/head^2
epenet 2024-08-16 10:26:12 +02:00 committed by GitHub
parent f9ade788eb
commit 66a8733333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 14 deletions

View File

@ -115,18 +115,27 @@ class BroadlinkDevice:
"""Representation of a Broadlink device."""
def __init__(
self, name, host, mac, model, manufacturer, type_, devtype, fwversion, timeout
):
self,
name: str,
host: str,
mac: str,
model: str,
manufacturer: str,
type_: str,
devtype: int,
fwversion: int,
timeout: int,
) -> None:
"""Initialize the device."""
self.name: str = name
self.host: str = host
self.mac: str = mac
self.model: str = model
self.manufacturer: str = manufacturer
self.type: str = type_
self.devtype: int = devtype
self.timeout: int = timeout
self.fwversion: int = fwversion
self.name = name
self.host = host
self.mac = mac
self.model = model
self.manufacturer = manufacturer
self.type = type_
self.devtype = devtype
self.timeout = timeout
self.fwversion = fwversion
async def setup_entry(self, hass, mock_api=None, mock_entry=None):
"""Set up the device."""

View File

@ -54,7 +54,12 @@ def async_restart(hass, entity_id=None):
class MockFFmpegDev(ffmpeg.FFmpegBase):
"""FFmpeg device mock."""
def __init__(self, hass, initial_state=True, entity_id="test.ffmpeg_device"):
def __init__(
self,
hass: HomeAssistant,
initial_state: bool = True,
entity_id: str = "test.ffmpeg_device",
) -> None:
"""Initialize mock."""
super().__init__(None, initial_state)

View File

@ -2322,7 +2322,7 @@ async def test_connect_args_priority(hass: HomeAssistant, config_url) -> None:
__bases__ = []
_has_events = False
def __init__(*args, **kwargs): ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
@property
def is_async(self):

View File

@ -27,7 +27,7 @@ class MockSirenEntity(SirenEntity):
supported_features=0,
available_tones_as_attr=None,
available_tones_in_desc=None,
):
) -> None:
"""Initialize mock siren entity."""
self._attr_supported_features = supported_features
if available_tones_as_attr is not None: