diff --git a/setup.py b/setup.py index 4043f6b6..654d9bfb 100644 --- a/setup.py +++ b/setup.py @@ -17,12 +17,13 @@ from setuptools import setup from os import path +from thingsboard_gateway.gateway.constants import VERSION + + this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() -VERSION = "3.2" - setup( version=VERSION, name="thingsboard-gateway", diff --git a/thingsboard_gateway/gateway/constants.py b/thingsboard_gateway/gateway/constants.py index 3364e211..59e9fb1a 100644 --- a/thingsboard_gateway/gateway/constants.py +++ b/thingsboard_gateway/gateway/constants.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +VERSION = "3.2" # Service constants diff --git a/thingsboard_gateway/tb_utility/tb_updater.py b/thingsboard_gateway/tb_utility/tb_updater.py index bb228021..a338e2d4 100644 --- a/thingsboard_gateway/tb_utility/tb_updater.py +++ b/thingsboard_gateway/tb_utility/tb_updater.py @@ -23,8 +23,10 @@ from pkg_resources import get_distribution from requests import ConnectionError, post from simplejson import loads +from thingsboard_gateway.gateway.constants import VERSION from thingsboard_gateway.tb_utility.tb_utility import TBUtility + log = getLogger("service") UPDATE_SERVICE_BASE_URL = "https://updates.thingsboard.io" @@ -38,7 +40,7 @@ class TBUpdater(Thread): self.__version = {"current_version": get_distribution('thingsboard_gateway').version, "latest_version": get_distribution('thingsboard_gateway').version} except DistributionNotFound: - self.__version = {"current_version": "0", "latest_version": "0"} + self.__version = {"current_version": f"v{VERSION}", "latest_version": f"v{VERSION}"} self.__instance_id = str(uuid1()) self.__platform = system()