Skip to content

Commit

Permalink
Merge branch 'beta'
Browse files Browse the repository at this point in the history
# Conflicts:
#	setup.py
  • Loading branch information
markusressel committed Nov 23, 2017
2 parents 5eb3075 + e6f455f commit 1f58f8f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Build Status
.. |codebeat_master| image:: https://codebeat.co/badges/9dd4227d-a247-4c9b-9091-7472f3e19434
:target: https://codebeat.co/projects/github-com-markusressel-sunix-ledstrip-controller-client-master

.. |codebeat_beta| image:: image:: https://codebeat.co/badges/256be541-3755-45f3-91ca-XXXXXXX
.. |codebeat_beta| image:: https://codebeat.co/badges/68d80d07-2c69-4320-9f0a-02165dafae11
:target: https://codebeat.co/projects/github-com-markusressel-sunix-ledstrip-controller-client-beta

.. |codebeat_dev| image:: https://codebeat.co/badges/256be541-3755-45f3-91ca-12f1257cd9a5
Expand Down
26 changes: 24 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
import subprocess

from setuptools import setup, find_packages

VERSION_NUMBER = "1.2.1"

GIT_BRANCH = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"])
GIT_BRANCH = GIT_BRANCH.decode() # convert to standard string
GIT_BRANCH = GIT_BRANCH.rstrip() # remove unnecessary whitespace

if GIT_BRANCH == "master":
DEVELOPMENT_STATUS = "Development Status :: 5 - Production/Stable"
VERSION_NAME = VERSION_NUMBER
elif GIT_BRANCH == "beta":
DEVELOPMENT_STATUS = "Development Status :: 4 - Beta"
VERSION_NAME = "%s-beta" % VERSION_NUMBER
elif GIT_BRANCH == "dev":
DEVELOPMENT_STATUS = "Development Status :: 3 - Alpha"
VERSION_NAME = "%s-dev" % VERSION_NUMBER
else:
print("Unknown git branch, using pre-alpha as default")
DEVELOPMENT_STATUS = "Development Status :: 2 - Pre-Alpha"
VERSION_NAME = "%s-%s" % (VERSION_NUMBER, GIT_BRANCH)

setup(
name='sunix_ledstrip_controller_client',
version='1.2.0',
version=VERSION_NAME,
description='A library for controlling the Sunix RGB / RGBWWCW WiFi LED Strip controller',
license='GPLv3+',
author='Markus Ressel',
author_email='[email protected]',
url='https://www.markusressel.de',
packages=find_packages(),
classifiers=[
'Development Status :: 5 - Production/Stable',
DEVELOPMENT_STATUS,
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 3',
],
Expand Down
8 changes: 4 additions & 4 deletions sunix_ledstrip_controller_client/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def __init__(self, host: str, port: int = DEFAULT_PORT, hardware_id: str = None,
self._rgbww = None

def __str__(self):
return ("Host: " + self.get_host() + "\n" +
"Port: " + str(self.get_port()) + "\n" +
"Hardware ID: " + self.get_hardware_id() + "\n" +
"Model: " + self.get_model())
return ("Host: %s\n" % (self.get_host()) +
"Port: %s\n" % (self.get_port()) +
"Hardware ID: %s\n" % (self.get_hardware_id()) +
"Model: %s" % (self.get_model()))

def get_host(self) -> str or None:
"""
Expand Down

0 comments on commit 1f58f8f

Please sign in to comment.