Skip to content

Commit 33b8865

Browse files
committed
Get version number from single location.
1 parent 14a2c82 commit 33b8865

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

cayenne/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "1.0.0"

cayenne/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import paho.mqtt.client as mqtt
22
import time
3+
from cayenne import __version__
34

45
# Data types
56
TYPE_BAROMETRIC_PRESSURE = "bp" # Barometric pressure
@@ -55,7 +56,7 @@ def on_connect(client, cayenne, rc):
5556
print("SUB %s\n" % command_topic)
5657
client.subscribe(command_topic)
5758
cayenne.mqttPublish("%s/sys/model" % cayenne.rootTopic, "Python")
58-
cayenne.mqttPublish("%s/sys/version" % cayenne.rootTopic, "1.0")
59+
cayenne.mqttPublish("%s/sys/version" % cayenne.rootTopic, __version__)
5960

6061
# The callback for when the client disconnects from the server.
6162
def on_disconnect(client, cayenne, rc):

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from setuptools import setup
22
from codecs import open
33
from os import path
4+
from cayenne import __version__
45

56
here = path.abspath(path.dirname(__file__))
67

@@ -25,7 +26,7 @@
2526
'Topic :: System :: Monitoring']
2627

2728
setup(name = 'cayenne-mqtt',
28-
version = '1.0.0',
29+
version = __version__,
2930
author = 'myDevices',
3031
author_email = 'N/A',
3132
description = 'Cayenne MQTT Python Library',
@@ -34,7 +35,7 @@
3435
keywords = 'myDevices Cayenne MQTT',
3536
url = 'https://github.com/myDevicesIoT/Cayenne-MQTT-Python',
3637
classifiers = classifiers,
37-
packages = ['cayenne-mqtt'],
38+
packages = ['cayenne'],
3839
install_requires = [
3940
'paho-mqtt',
4041
],

0 commit comments

Comments
 (0)