Skip to content

Commit 88c3bc4

Browse files
committed
IO_MQTT instead of Any.
1 parent f606224 commit 88c3bc4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

adafruit_dash_display.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"""
2525
try:
2626
from typing import Tuple, Callable, Optional, Any
27+
from adafruit_io.adafruit_io import IO_MQTT
2728
except ImportError:
2829
pass
2930

@@ -34,7 +35,6 @@
3435
import digitalio
3536
from adafruit_display_shapes.rect import Rect
3637
from adafruit_display_text.label import Label
37-
from adafruit_io.adafruit_io import IO_MQTT
3838

3939
__version__ = "0.0.0+auto.0"
4040
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Dash_Display.git"
@@ -163,7 +163,7 @@ def __init__(
163163
self.display.show(self.splash)
164164

165165
def simple_text_callback(
166-
self, client: Any, feed_id: str, message: str
166+
self, client: IO_MQTT, feed_id: str, message: str
167167
): # pylint: disable=unused-argument
168168
"""Default callback function that uses the text in the Feed object and the color callback
169169
to set the text"""
@@ -175,7 +175,7 @@ def simple_text_callback(
175175
text = feed.text.format(float(message))
176176
return text
177177

178-
def update_text(self, client: Any, feed_id: str, message: str):
178+
def update_text(self, client: IO_MQTT, feed_id: str, message: str):
179179
"""Updates the text on the display"""
180180
feed = self.feeds[feed_id]
181181
feed.callback(client, feed_id, message)
@@ -252,21 +252,21 @@ def get(self):
252252

253253
# pylint: disable=unused-argument
254254
@staticmethod
255-
def connected(client: Any):
255+
def connected(client: IO_MQTT):
256256
"""Callback for when the device is connected to Adafruit IO"""
257257
print("Connected to Adafruit IO!")
258258

259259
@staticmethod
260-
def subscribe(client: Any, userdata: Any, topic: str, granted_qos: str):
260+
def subscribe(client: IO_MQTT, userdata: Any, topic: str, granted_qos: str):
261261
"""Callback for when a new feed is subscribed to"""
262262
print("Subscribed to {0} with QOS level {1}".format(topic, granted_qos))
263263

264264
@staticmethod
265-
def disconnected(client: Any):
265+
def disconnected(client: IO_MQTT):
266266
"""Callback for when the device disconnects from Adafruit IO"""
267267
print("Disconnected from Adafruit IO!")
268268

269-
def message(self, client: Any, feed_id: str, message: str):
269+
def message(self, client: IO_MQTT, feed_id: str, message: str):
270270
"""Callback for whenever a new message is received"""
271271
print("Feed {0} received new value: {1}".format(feed_id, message))
272272
feed_id = feed_id.split("/")[-1]

0 commit comments

Comments
 (0)