Skip to content

Commit

Permalink
Make __init__ return consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
denpamusic committed Oct 15, 2024
1 parent cf0f1c4 commit 09e9731
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pyplumio/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Device(ABC, EventManager):

queue: asyncio.Queue[Frame]

def __init__(self, queue: asyncio.Queue[Frame]):
def __init__(self, queue: asyncio.Queue[Frame]) -> None:
"""Initialize a new device."""
super().__init__()
self.queue = queue
Expand Down Expand Up @@ -126,7 +126,7 @@ class PhysicalDevice(Device, ABC):
_network: NetworkInfo
_setup_frames: tuple[DataFrameDescription, ...]

def __init__(self, queue: asyncio.Queue[Frame], network: NetworkInfo):
def __init__(self, queue: asyncio.Queue[Frame], network: NetworkInfo) -> None:
"""Initialize a new physical device."""
super().__init__(queue)
self._network = network
Expand Down Expand Up @@ -188,7 +188,7 @@ class VirtualDevice(Device, ABC):

def __init__(
self, queue: asyncio.Queue[Frame], parent: PhysicalDevice, index: int = 0
):
) -> None:
"""Initialize a new sub-device."""
super().__init__(queue)
self.parent = parent
Expand Down
2 changes: 1 addition & 1 deletion pyplumio/devices/ecomax.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class EcoMAX(PhysicalDevice):
_fuel_burned_timestamp_ns: int
_setup_frames = SETUP_FRAME_TYPES

def __init__(self, queue: asyncio.Queue[Frame], network: NetworkInfo):
def __init__(self, queue: asyncio.Queue[Frame], network: NetworkInfo) -> None:
"""Initialize a new ecoMAX controller."""
super().__init__(queue, network)
self._frame_versions = {}
Expand Down
2 changes: 1 addition & 1 deletion pyplumio/devices/mixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Mixer(VirtualDevice):

def __init__(
self, queue: asyncio.Queue[Frame], parent: PhysicalDevice, index: int = 0
):
) -> None:
"""Initialize a new mixer."""
super().__init__(queue, parent, index)
self.subscribe(ATTR_MIXER_SENSORS, self._handle_mixer_sensors)
Expand Down
2 changes: 1 addition & 1 deletion pyplumio/devices/thermostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Thermostat(VirtualDevice):

def __init__(
self, queue: asyncio.Queue[Frame], parent: PhysicalDevice, index: int = 0
):
) -> None:
"""Initialize a new thermostat."""
super().__init__(queue, parent, index)
self.subscribe(ATTR_THERMOSTAT_SENSORS, self._handle_thermostat_sensors)
Expand Down
10 changes: 5 additions & 5 deletions pyplumio/helpers/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DataType(ABC, Generic[T]):
_value: T
_size: int

def __init__(self, value: T | None = None):
def __init__(self, value: T | None = None) -> None:
"""Initialize a new data type."""
if value is not None:
self._value = value
Expand Down Expand Up @@ -112,7 +112,7 @@ class BitArray(DataType[int]):

_index: int

def __init__(self, value: bool | None = None, index: int = 0):
def __init__(self, value: bool | None = None, index: int = 0) -> None:
"""Initialize a new bit array."""
super().__init__(value)
self._index = index
Expand Down Expand Up @@ -199,7 +199,7 @@ class String(DataType[str]):

__slots__ = ()

def __init__(self, value: str = ""):
def __init__(self, value: str = "") -> None:
"""Initialize a new null-terminated string data type."""
super().__init__(value)
self._size = len(self.value) + 1
Expand All @@ -219,7 +219,7 @@ class VarBytes(DataType[bytes]):

__slots__ = ()

def __init__(self, value: bytes = b""):
def __init__(self, value: bytes = b"") -> None:
"""Initialize a new variable-length bytes data type."""
super().__init__(value)
self._size = len(value) + 1
Expand All @@ -239,7 +239,7 @@ class VarString(DataType[str]):

__slots__ = ()

def __init__(self, value: str = ""):
def __init__(self, value: str = "") -> None:
"""Initialize a new variable length bytes data type."""
super().__init__(value)
self._size = len(value) + 1
Expand Down
2 changes: 1 addition & 1 deletion pyplumio/helpers/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ScheduleDay(MutableMapping):

_intervals: list[bool]

def __init__(self, intervals: list[bool]):
def __init__(self, intervals: list[bool]) -> None:
"""Initialize a new schedule day."""
self._intervals = intervals

Expand Down
2 changes: 1 addition & 1 deletion pyplumio/structures/thermostat_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(
values: ParameterValues | None = None,
index: int = 0,
offset: int = 0,
):
) -> None:
"""Initialize a new thermostat parameter."""
self.offset = offset
super().__init__(device, description, values, index)
Expand Down

0 comments on commit 09e9731

Please sign in to comment.