Skip to content

Commit 2d93548

Browse files
committed
chore(lint): Address various linting issues
1 parent d01c9b4 commit 2d93548

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

aps2mqtt/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
__version__ = "1.2.0"
1+
"""Initialize the aps2mqtt package."""
2+
3+
__version__ = "1.2.0"

aps2mqtt/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"""Run the main application."""
2+
13
from aps2mqtt.main import main
24

3-
main()
5+
if __name__ == "__main__":
6+
main()

aps2mqtt/mqtthandler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ def __init__(self, mqtt_config):
2424
)
2525
self.client = None
2626

27+
# pylint: disable=too-many-arguments, too-many-positional-arguments
2728
def on_connect(self, client, userdata, flags, reason_code, properties):
2829
"""Callback function on broker connection"""
29-
del client, userdata, flags
30+
del client, userdata, flags, properties
3031
if reason_code == 0:
3132
_LOGGER.info("Connected to MQTT Broker!")
3233
else:
3334
_LOGGER.error(
3435
"Failed to connect: %s", mqtt_client.connack_string(reason_code)
3536
)
3637

38+
# pylint: disable=too-many-arguments, too-many-positional-arguments
3739
def on_disconnect(self, client, userdata, flags, reason_code, properties):
3840
"""Callback function on broker disconnection"""
3941
del client, userdata, flags, properties

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ pylint-exit = "^1.2.0"
3636
[build-system]
3737
requires = ["poetry-core"]
3838
build-backend = "poetry.core.masonry.api"
39+
40+
[tool.pylint.main]
41+
ignore = ["aps2mqtt/apsystems"]

0 commit comments

Comments
 (0)