summaryrefslogtreecommitdiff
path: root/examples/IoT_TestDevice.py
diff options
context:
space:
mode:
authorRobert Robinson <rerobins@gmail.com>2015-09-18 13:30:30 -0600
committerRobert Robinson <rerobins@gmail.com>2015-09-18 13:30:30 -0600
commit5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d (patch)
treed21287dbbb7882b766098e0a81c0d1d3677d28d3 /examples/IoT_TestDevice.py
parente5582694c07236e6830c20361840360a1dde37f3 (diff)
parentd245558fd5eeee4fa34731ccea47c4c3132d805f (diff)
downloadslixmpp-5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d.tar.gz
slixmpp-5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d.tar.bz2
slixmpp-5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d.tar.xz
slixmpp-5fc14de32e7fbd4e33a0e1ed92d8fb23871a2a2d.zip
Merge pull request #3 from fritzy/develop
Merge to fritzy_master
Diffstat (limited to 'examples/IoT_TestDevice.py')
-rwxr-xr-xexamples/IoT_TestDevice.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/examples/IoT_TestDevice.py b/examples/IoT_TestDevice.py
index 8105aaff..b85a0b7c 100755
--- a/examples/IoT_TestDevice.py
+++ b/examples/IoT_TestDevice.py
@@ -11,18 +11,10 @@
See the file LICENSE for copying permission.
"""
-import os
-import sys
-# This can be used when you are in a test environment and need to make paths right
-sys.path=['/Users/jocke/Dropbox/06_dev/SleekXMPP']+sys.path
-
+import getpass
import logging
-import unittest
-import distutils.core
-import datetime
+import sys
-from glob import glob
-from os.path import splitext, basename, join as pjoin
from optparse import OptionParser
from urllib import urlopen
@@ -39,8 +31,6 @@ else:
from sleekxmpp.plugins.xep_0323.device import Device
-#from sleekxmpp.exceptions import IqError, IqTimeout
-
class IoT_TestDevice(sleekxmpp.ClientXMPP):
"""
@@ -179,13 +169,13 @@ if __name__ == '__main__':
# node=opts.nodeid,
# jid=xmpp.boundjid.full)
- myDevice = TheDevice(opts.nodeid);
+ myDevice = TheDevice(opts.nodeid)
# myDevice._add_field(name="Relay", typename="numeric", unit="Bool");
- myDevice._add_field(name="Temperature", typename="numeric", unit="C");
+ myDevice._add_field(name="Temperature", typename="numeric", unit="C")
myDevice._set_momentary_timestamp("2013-03-07T16:24:30")
- myDevice._add_field_momentary_data("Temperature", "23.4", flags={"automaticReadout": "true"});
+ myDevice._add_field_momentary_data("Temperature", "23.4", flags={"automaticReadout": "true"})
- xmpp['xep_0323'].register_node(nodeId=opts.nodeid, device=myDevice, commTimeout=10);
+ xmpp['xep_0323'].register_node(nodeId=opts.nodeid, device=myDevice, commTimeout=10)
xmpp.beClientOrServer(server=True)
while not(xmpp.testForRelease()):
xmpp.connect()