Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rroemhild committed Nov 28, 2019
1 parent 2f3d1a8 commit 88f2dc5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
12 changes: 7 additions & 5 deletions homie/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
STATE_INIT,
STATE_READY,
STATE_RECOVER,
T_BC,
T_SET,
UNDERSCORE,
UTF8,
WDT_DELAY,
T_SET,
T_BC,
)
from mqtt_as import LINUX, MQTTClient
from uasyncio import get_event_loop, sleep_ms
Expand Down Expand Up @@ -152,7 +152,7 @@ async def connection_handler(self, client):

# unsubscribe from retained topic (restore)
for t in retained:
await self.unsubscribe(t)
await unsubscribe(t)

self._first_start = False

Expand All @@ -168,7 +168,9 @@ async def connection_handler(self, client):
await self.publish(DEVICE_STATE, STATE_READY)

def sub_cb(self, topic, payload, retained):
self.dprint("MQTT MESSAGE: {} --> {}, {}".format(topic, payload, retained))
self.dprint(
"MQTT MESSAGE: {} --> {}, {}".format(topic, payload, retained)
)

# Only non-retained messages are allowed on /set topics
if retained and topic.endswith(T_SET):
Expand All @@ -191,7 +193,7 @@ async def publish(self, topic, payload, retain=True):
payload = bytes(str(payload), UTF8)

t = SLASH.join((self.dtopic, topic))
self.dprint('MQTT PUBLISH: {} --> {}'.format(t, payload))
self.dprint("MQTT PUBLISH: {} --> {}".format(t, payload))
await self.mqtt.publish(t, payload, retain, QOS)

async def broadcast(self, payload, level=None):
Expand Down
2 changes: 1 addition & 1 deletion homie/node.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from homie.constants import FALSE, PUBLISH_DELAY, TRUE, SET, SLASH
from homie.constants import FALSE, PUBLISH_DELAY, SET, SLASH, TRUE
from homie.device import await_ready_state
from uasyncio import sleep_ms

Expand Down
2 changes: 1 addition & 1 deletion homie/property.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from homie.utils import payload_is_valid
from homie.constants import STRING
from homie.utils import payload_is_valid


class HomieNodeProperty:
Expand Down
13 changes: 6 additions & 7 deletions homie/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from mqtt_as import LINUX
from homie.constants import (
STRING,
INTEGER,
ENUM,
BOOLEAN,
COLOR,
ENUM,
FALSE,
FLOAT,
INTEGER,
STRING,
TRUE,
FALSE,
COLOR,
)

from mqtt_as import LINUX

if LINUX is False:
from network import WLAN, AP_IF
Expand Down

0 comments on commit 88f2dc5

Please sign in to comment.