Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up misc linter warnings from Pylint #29

Merged
merged 15 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix misc lint about argument naming
  • Loading branch information
mill1000 committed Aug 17, 2023
commit 4ccaa3fe4458b80c1d5c654582a4d26975caf5f1
4 changes: 2 additions & 2 deletions msmart/device/AC/appliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ async def refresh(self):
cmd = get_state_command(self.type)
await self.send_command(cmd)

async def send_command(self, cmd, ignore_response=False):
responses = await super().send_command(cmd)
async def send_command(self, command, ignore_response=False):
responses = await super().send_command(command)

# Ignore responses if requested, or nonexistent
if ignore_response or responses is None:
Expand Down
8 changes: 4 additions & 4 deletions msmart/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def data_received(self, data) -> None:

self.response = data

def connection_lost(self, ex):
def connection_lost(self, exc) -> None:
"""NOP implementation of connection lost."""


Expand Down Expand Up @@ -107,11 +107,11 @@ def datagram_received(self, data, addr) -> None:
task = asyncio.create_task(Discover._get_device(ip, version, data))
self.tasks.add(task)

def error_received(self, ex):
def error_received(self, exc) -> None:
"""Handle asyncio.Protocol errors."""
_LOGGER.error("Got error: %s", ex)
_LOGGER.error("Got error: %s", exc)

def connection_lost(self, ex):
def connection_lost(self, exc) -> None:
"""NOP implementation of connection lost."""


Expand Down
6 changes: 3 additions & 3 deletions msmart/lan.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ def data_received(self, data: bytes) -> None:
_LOGGER.debug("Received data from %s: %s", self.peer, data.hex())
self._queue.put_nowait(data)

def connection_lost(self, ex):
def connection_lost(self, exc) -> None:
"""Log connection lost."""
if ex:
_LOGGER.error("Connection to %s lost. Error: %s.", self.peer, ex)
if exc:
_LOGGER.error("Connection to %s lost. Error: %s.", self.peer, exc)

def disconnect(self) -> None:
"""Disconnect from the peer."""
Expand Down