Commit b464c431 authored by nextime's avatar nextime

two little minor fixes

parent 5e2d5510
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
{ {
?> ?>
<tr> <tr>
<td><?=$timer['timer_name']?></td> <td><?=$timer['description']?></td>
<? if($timer['active']>0) { ?> <? if($timer['active']>0) { ?>
<td><button class="btn btn-success btn-small pull-right">Active</button></td> <td><button class="btn btn-success btn-small pull-right">Active</button></td>
<? } else { ?> <? } else { ?>
......
...@@ -968,6 +968,24 @@ class domotikaService(service.Service): ...@@ -968,6 +968,24 @@ class domotikaService(service.Service):
ret=doQuery("SELECT active FROM timers WHERE id="+str(tid[0]), reverse) ret=doQuery("SELECT active FROM timers WHERE id="+str(tid[0]), reverse)
except: except:
pass pass
elif len(tid)>0 and len(tid[0])>0:
try:
ret=doQuery("SELECT IF(SUM(active)>0,1,0) from timers WHERE DMDOMAIN(timer_name, '"+str(tid[0])+"')=1")
except:
pass
elif trigger.startswith("ACTIONSTATUS ") or trigger.startswith("ACTIONSTATUS:"):
aid=trigger[13:].split()
if len(aid)>0 and genutils.is_number(aid[0]):
try:
ret=doQuery("SELECT active FROM actions WHERE id="+str(aid[0]), reverse)
except:
pass
elif len(aid)>0 and len(aid[0])>0:
try:
ret=doQuery("SELECT IF(SUM(active)>0,1,0) from actions WHERE DMDOMAIN(action_name, '"+str(aid[0])+"')=1")
except:
pass
elif trigger.startswith("BOARDSTATUS ") or trigger.startswith("BOARDSTATUS:"): elif trigger.startswith("BOARDSTATUS ") or trigger.startswith("BOARDSTATUS:"):
bname=trigger[12:].split() bname=trigger[12:].split()
if len(bname)>0: if len(bname)>0:
...@@ -989,6 +1007,14 @@ class domotikaService(service.Service): ...@@ -989,6 +1007,14 @@ class domotikaService(service.Service):
ret=doQuery("SELECT status FROM relstatus WHERE buttonid="+str(tid[0]), reverse) ret=doQuery("SELECT status FROM relstatus WHERE buttonid="+str(tid[0]), reverse)
except: except:
pass pass
elif trigger.startswith("ACTSTATUS ") or trigger.startswith("ACTSTATUS:"):
tid=trigger[10:].split()
if len(tid)>0 and genutils.is_number(tid[0]):
try:
ret=doQuery("SELECT status FROM actstatus WHERE buttonid="+str(tid[0]), reverse)
except:
pass
elif trigger.startswith("AMPSTATUS ") or trigger.startswith("AMPSTATUS:"): elif trigger.startswith("AMPSTATUS ") or trigger.startswith("AMPSTATUS:"):
if ':' in trigger: if ':' in trigger:
amp=trigger[10:].split(":") amp=trigger[10:].split(":")
...@@ -1632,7 +1658,7 @@ class domotikaService(service.Service): ...@@ -1632,7 +1658,7 @@ class domotikaService(service.Service):
ss.del_status(res.id) ss.del_status(res.id)
return return
ret=defer.succeed(False) ret=defer.succeed(False)
trigger=res.trigger trigger=res.status_trigger
self.parseStatusRequest(trigger, restype='string').addCallback(self.manageStatusAction, res) self.parseStatusRequest(trigger, restype='string').addCallback(self.manageStatusAction, res)
@defer.inlineCallbacks @defer.inlineCallbacks
......
...@@ -25,7 +25,7 @@ def getMediaSourcePlugin(name, manufacturer='generic'): ...@@ -25,7 +25,7 @@ def getMediaSourcePlugin(name, manufacturer='generic'):
return None return None
for p in getPlugins(imediasource.IMediaSource, mod ): for p in getPlugins(imediasource.IMediaSource, mod ):
qual = "%s.%s" % (p.__module__, p.__class__.__name__) qual = "%s.%s" % (p.__module__, p.__class__.__name__)
log.debug("Calling Board Module "+qual) log.debug("Calling MediaSource Module "+qual)
if p.__module__.split('.')[-1]==name: if p.__module__.split('.')[-1]==name:
return p return p
return None return None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment