Skip to content

Commit d7074a5

Browse files
committed
cleanup
1 parent 0bc716a commit d7074a5

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

example.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55

66
from thinq2.controller.auth import ThinQAuth
77
from thinq2.controller.thinq import ThinQ
8-
from thinq2.client.objectstore import ObjectStoreClient
98

109
LANGUAGE_CODE = os.environ.get("LANGUAGE_CODE", "ko-KR")
1110
COUNTRY_CODE = os.environ.get("COUNTRY_CODE", "KR")
1211
STATE_FILE = os.environ.get("STATE_FILE", "state.json")
1312

14-
#################################################################################
15-
# load from existing state or create a new client #
16-
#################################################################################
13+
#############################################################################
14+
# load from existing state or create a new client #
15+
#############################################################################
1716
if os.path.exists(STATE_FILE):
1817
with open(STATE_FILE, "r") as f:
1918
thinq = ThinQ(json.load(f))
@@ -35,25 +34,27 @@
3534

3635
print("\n")
3736

37+
3838
def save_state():
3939
with open(STATE_FILE, "w") as f:
4040
json.dump(vars(thinq), f)
4141

42+
4243
save_state()
4344

44-
#################################################################################
45-
# state is easily serialized in dict form, as in this shutdown handler #
46-
#################################################################################
45+
#############################################################################
46+
# state is easily serialized in dict form, as in this shutdown handler #
47+
#############################################################################
4748
def shutdown(sig, frame):
4849
print("\nCaught SIGINT, saving application state.")
4950
exit(0)
5051

5152

5253
signal.signal(signal.SIGINT, shutdown)
5354

54-
#################################################################################
55-
# display some information about the user's account/devices #
56-
#################################################################################
55+
#############################################################################
56+
# display some information about the user's account/devices #
57+
#############################################################################
5758
devices = thinq.mqtt.thinq_client.get_devices()
5859

5960
if len(devices.items) == 0:
@@ -63,15 +64,15 @@ def shutdown(sig, frame):
6364

6465
print("UserID: {}".format(thinq.auth.profile.user_id))
6566
print("User #: {}\n".format(thinq.auth.profile.user_no))
66-
6767
print("Devices:\n")
6868

69+
6970
for device in devices.items:
7071
print("{}: {} (model {})".format(device.device_id, device.alias, device.model_name))
7172

72-
#################################################################################
73-
# example of raw MQTT access #
74-
#################################################################################
73+
#############################################################################
74+
# example of raw MQTT access #
75+
#############################################################################
7576

7677
print("\nListening for device events. Use Ctrl-C/SIGINT to quit.\n")
7778

tests/test_schema.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import pytest
22

3-
import marshmallow
43
from marshmallow_dataclass import dataclass
54

65
from thinq2 import schema

0 commit comments

Comments
 (0)