Skip to content

Commit 98ed369

Browse files
authored
Merge pull request #33 from adafruit/black-update
Black reformatting with Python 3 target.
2 parents 5cb8c04 + 42a3e4a commit 98ed369

File tree

7 files changed

+43
-26
lines changed

7 files changed

+43
-26
lines changed

adafruit_io/adafruit_io.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def reconnect(self):
108108
except:
109109
raise AdafruitIO_MQTTError("Unable to reconnect to Adafruit IO.")
110110

111-
112111
def connect(self):
113112
"""Connects to the Adafruit IO MQTT Broker.
114113
Must be called before any other API methods are called.

docs/conf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@
3131
master_doc = "index"
3232

3333
# General information about the project.
34-
project = u"Adafruit Adafruit_IO Library"
35-
copyright = u"2019 Brent Rubell"
36-
author = u"Brent Rubell"
34+
project = "Adafruit Adafruit_IO Library"
35+
copyright = "2019 Brent Rubell"
36+
author = "Brent Rubell"
3737

3838
# The version info for the project you're documenting, acts as replacement for
3939
# |version| and |release|, also used in various other places throughout the
4040
# built documents.
4141
#
4242
# The short X.Y version.
43-
version = u"1.0"
43+
version = "1.0"
4444
# The full version, including alpha/beta/rc tags.
45-
release = u"1.0"
45+
release = "1.0"
4646

4747
# The language for content autogenerated by Sphinx. Refer to documentation
4848
# for a list of supported languages.
@@ -133,7 +133,7 @@
133133
(
134134
master_doc,
135135
"AdafruitAdafruit_IOLibrary.tex",
136-
u"AdafruitAdafruit_IO Library Documentation",
136+
"AdafruitAdafruit_IO Library Documentation",
137137
author,
138138
"manual",
139139
),
@@ -147,7 +147,7 @@
147147
(
148148
master_doc,
149149
"AdafruitAdafruit_IOlibrary",
150-
u"Adafruit Adafruit_IO Library Documentation",
150+
"Adafruit Adafruit_IO Library Documentation",
151151
[author],
152152
1,
153153
)
@@ -162,7 +162,7 @@
162162
(
163163
master_doc,
164164
"AdafruitAdafruit_IOLibrary",
165-
u"Adafruit Adafruit_IO Library Documentation",
165+
"Adafruit Adafruit_IO Library Documentation",
166166
author,
167167
"AdafruitAdafruit_IOLibrary",
168168
"One line description of project.",

examples/mqtt/adafruit_io_groups.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def message(client, feed_id, payload):
7676
# the new value.
7777
print("Feed {0} received new value: {1}".format(feed_id, payload))
7878

79+
7980
# Connect to WiFi
8081
print("Connecting to WiFi...")
8182
wifi.connect()
@@ -85,9 +86,11 @@ def message(client, feed_id, payload):
8586
MQTT.set_socket(socket, esp)
8687

8788
# Initialize a new MQTT Client object
88-
mqtt_client = MQTT.MQTT(broker="https://io.adafruit.com",
89-
username=secrets["aio_user"],
90-
password=secrets["aio_key"])
89+
mqtt_client = MQTT.MQTT(
90+
broker="https://io.adafruit.com",
91+
username=secrets["aio_user"],
92+
password=secrets["aio_key"],
93+
)
9194

9295
# Initialize an Adafruit IO MQTT Client
9396
io = IO_MQTT(mqtt_client)

examples/mqtt/adafruit_io_location.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def message(client, feed_id, payload):
7575
# the new value.
7676
print("Feed {0} received new value: {1}".format(feed_id, payload))
7777

78+
7879
# Connect to WiFi
7980
print("Connecting to WiFi...")
8081
wifi.connect()
@@ -84,9 +85,11 @@ def message(client, feed_id, payload):
8485
MQTT.set_socket(socket, esp)
8586

8687
# Initialize a new MQTT Client object
87-
mqtt_client = MQTT.MQTT(broker="https://io.adafruit.com",
88-
username=secrets["aio_user"],
89-
password=secrets["aio_key"])
88+
mqtt_client = MQTT.MQTT(
89+
broker="https://io.adafruit.com",
90+
username=secrets["aio_user"],
91+
password=secrets["aio_key"],
92+
)
9093

9194
# Initialize an Adafruit IO MQTT Client
9295
io = IO_MQTT(mqtt_client)

examples/mqtt/adafruit_io_simpletest.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def message(client, feed_id, payload):
8989
# the new value.
9090
print("Feed {0} received new value: {1}".format(feed_id, payload))
9191

92+
9293
# Connect to WiFi
9394
print("Connecting to WiFi...")
9495
wifi.connect()
@@ -98,9 +99,11 @@ def message(client, feed_id, payload):
9899
MQTT.set_socket(socket, esp)
99100

100101
# Initialize a new MQTT Client object
101-
mqtt_client = MQTT.MQTT(broker="https://io.adafruit.com",
102-
username=secrets["aio_user"],
103-
password=secrets["aio_key"])
102+
mqtt_client = MQTT.MQTT(
103+
broker="https://io.adafruit.com",
104+
username=secrets["aio_user"],
105+
password=secrets["aio_key"],
106+
)
104107

105108

106109
# Initialize an Adafruit IO MQTT Client

examples/mqtt/adafruit_io_simpletest_eth.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,40 @@ def connected(client):
4040
# Subscribe to changes on a feed named DemoFeed.
4141
client.subscribe("DemoFeed")
4242

43+
4344
def subscribe(client, userdata, topic, granted_qos):
4445
# This method is called when the client subscribes to a new feed.
45-
print('Subscribed to {0} with QOS level {1}'.format(topic, granted_qos))
46+
print("Subscribed to {0} with QOS level {1}".format(topic, granted_qos))
47+
4648

4749
def unsubscribe(client, userdata, topic, pid):
4850
# This method is called when the client unsubscribes from a feed.
49-
print('Unsubscribed from {0} with PID {1}'.format(topic, pid))
51+
print("Unsubscribed from {0} with PID {1}".format(topic, pid))
52+
5053

5154
# pylint: disable=unused-argument
5255
def disconnected(client):
5356
# Disconnected function will be called when the client disconnects.
5457
print("Disconnected from Adafruit IO!")
5558

59+
5660
# pylint: disable=unused-argument
5761
def message(client, feed_id, payload):
5862
# Message function will be called when a subscribed feed has a new value.
5963
# The feed_id parameter identifies the feed, and the payload parameter has
6064
# the new value.
6165
print("Feed {0} received new value: {1}".format(feed_id, payload))
6266

67+
6368
# Initialize MQTT interface with the ethernet interface
6469
MQTT.set_socket(socket, eth)
6570

6671
# Initialize a new MQTT Client object
67-
mqtt_client = MQTT.MQTT(broker="http://io.adafruit.com",
68-
username=secrets["aio_user"],
69-
password=secrets["aio_key"])
72+
mqtt_client = MQTT.MQTT(
73+
broker="http://io.adafruit.com",
74+
username=secrets["aio_user"],
75+
password=secrets["aio_key"],
76+
)
7077

7178
# Initialize an Adafruit IO MQTT Client
7279
io = IO_MQTT(mqtt_client)

examples/mqtt/adafruit_io_time.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ def message(client, feed_id, payload):
9999
MQTT.set_socket(socket, esp)
100100

101101
# Initialize a new MQTT Client object
102-
mqtt_client = MQTT.MQTT(broker="https://io.adafruit.com",
103-
username=secrets["aio_user"],
104-
password=secrets["aio_key"])
102+
mqtt_client = MQTT.MQTT(
103+
broker="https://io.adafruit.com",
104+
username=secrets["aio_user"],
105+
password=secrets["aio_key"],
106+
)
105107

106108
# Initialize an Adafruit IO MQTT Client
107109
io = IO_MQTT(mqtt_client)

0 commit comments

Comments
 (0)