four spaces
This commit is contained in:
parent
ed3b37439a
commit
d1b6208435
1 changed files with 29 additions and 29 deletions
|
@ -9,34 +9,34 @@ print "Devices: %d\n" % devices
|
|||
allMethods = telldus.TELLDUS_TURNON | telldus.TELLDUS_TURNOFF | telldus.TELLDUS_BELL | telldus.TELLDUS_DIM
|
||||
|
||||
for i in xrange(devices):
|
||||
deviceid = telldus.tdGetDeviceId(i)
|
||||
name = tdGetName(deviceid)
|
||||
|
||||
print "%s - %s\n" % (deviceid, name)
|
||||
|
||||
methods = telldus.tdMethods(deviceid, allMethods)
|
||||
|
||||
if methods & telldus.TELLDUS_TURNON:
|
||||
print " * TurnOn\n"
|
||||
telldus.tdTurnOn(deviceid)
|
||||
time.sleep(1)
|
||||
|
||||
if methods & telldus.TELLDUS_TURNOFF:
|
||||
print " * TurnOff\n"
|
||||
telldus.tdTurnOff(deviceid)
|
||||
time.sleep(1)
|
||||
|
||||
if methods & telldus.TELLDUS_BELL:
|
||||
echo " * Bell\n"
|
||||
telldus.tdBell(deviceid)
|
||||
time.sleep(1)
|
||||
|
||||
if methods & telldus.TELLDUS_TOGGLE:
|
||||
print " * Toggle\n"
|
||||
|
||||
if methods & telldus.TELLDUS_DIM:
|
||||
print " * Dim\n"
|
||||
telldus.tdDim(deviceid, 128)
|
||||
time.sleep(1)
|
||||
deviceid = telldus.tdGetDeviceId(i)
|
||||
name = tdGetName(deviceid)
|
||||
|
||||
print "%s - %s\n" % (deviceid, name)
|
||||
|
||||
methods = telldus.tdMethods(deviceid, allMethods)
|
||||
|
||||
if methods & telldus.TELLDUS_TURNON:
|
||||
print " * TurnOn\n"
|
||||
telldus.tdTurnOn(deviceid)
|
||||
time.sleep(1)
|
||||
|
||||
if methods & telldus.TELLDUS_TURNOFF:
|
||||
print " * TurnOff\n"
|
||||
telldus.tdTurnOff(deviceid)
|
||||
time.sleep(1)
|
||||
|
||||
if methods & telldus.TELLDUS_BELL:
|
||||
echo " * Bell\n"
|
||||
telldus.tdBell(deviceid)
|
||||
time.sleep(1)
|
||||
|
||||
if methods & telldus.TELLDUS_TOGGLE:
|
||||
print " * Toggle\n"
|
||||
|
||||
if methods & telldus.TELLDUS_DIM:
|
||||
print " * Dim\n"
|
||||
telldus.tdDim(deviceid, 128)
|
||||
time.sleep(1)
|
||||
|
||||
telldus.tdClose()
|
Loading…
Add table
Add a link
Reference in a new issue