Github Mirror / telegraf-plugins: 2123ae35




Move debug to being an object property

Move debug to being an object property

Commit 2123ae35.

Authored 2023-05-14T13:27:36.000+01:00 by B Tasker in project Github Mirror / telegraf-plugins

+5 lines -3 lines

Commit Signature

Changes

diff --git a/soliscloud/soliscloud.py b/soliscloud/soliscloud.py
--- a/soliscloud/soliscloud.py
+++ b/soliscloud/soliscloud.py
# @@ -53,8 +53,9 @@ import time
#
# class SolisCloud:
#
# - def __init__(self, config, session=False):
# + def __init__(self, config, session=False, debug=False):
# self.config = config
# + self.debug = debug
# if session:
# self.session = session
# else:
# @@ -245,7 +246,7 @@ class SolisCloud:
#
#
# def printDebug(self, msg):
# - if DEBUG:
# + if self.debug:
# print(msg)
#
#
# @@ -270,9 +271,10 @@ def configFromEnv():
#
#
# if __name__ == "__main__":
# + # TODO: Take from environment
# DEBUG = True
# config = configFromEnv()
# - soliscloud = SolisCloud(config)
# + soliscloud = SolisCloud(config, debug=DEBUG)
#
# # These are the example values used in the API doc
# print(soliscloud.doAuth('2424',
#