Skip to content

Commit

Permalink
Merge #17 Detect script by @rzr
Browse files Browse the repository at this point in the history
  • Loading branch information
Leiaz committed May 31, 2020
2 parents 83f9b96 + 2cddbf8 commit 2650130
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions example/detect.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
# -*- mode: python; python-indent-offset: 4; indent-tabs-mode: nil -*-
# SPDX-License-Indentifier: MIT

''' Example '''

import os
import sys

PARENT_PATH = os.path.join(__file__, '..', '..', 'awoxmeshlight', '..')
LIB_PATH = os.path.abspath(PARENT_PATH)
sys.path.append(LIB_PATH)

from awoxmeshlight import AwoxMeshLight

MAC = os.getenv('MAC') or "A4:C1:38:FF:FF:FF"
print("info: Looking up mac=%s" % MAC)
LIGHT = AwoxMeshLight(MAC)
LIGHT.connect()
print("info: model=%s" % LIGHT.getModelNumber())
print("info: hardware=%s" % LIGHT.getHardwareRevision())
print("info: firmware=%s" % LIGHT.getFirmwareRevision())
LIGHT.disconnect()

0 comments on commit 2650130

Please sign in to comment.