Test version

This commit is contained in:
Ruben van de Ven 2019-01-28 17:26:48 +01:00
parent fd27706a48
commit 602633373e
3 changed files with 6 additions and 3 deletions

View file

@ -1,6 +1,7 @@
import json
import time
import logging
import re
import asyncio
@ -83,7 +84,7 @@ class Condition(object):
if not story.lastMsgFinishTime:
return False
return now - story.lastMsgFinishTime >= self.vars['seconds']
return now - story.lastMsgFinishTime >= float(self.vars['seconds'])
def _hasMetReplyContains(self, story):
if not story.currentMessage.hasReply():
@ -93,13 +94,14 @@ class Condition(object):
if 'regexCompiled' not in self.vars:
# Compile once, as we probably run it more than once
self.vars['regexCompiled'] = re.compile(self.vars['regex'])
result = re.match(self.vars['regexCompiled'])
result = re.match(self.vars['regexCompiled'], story.currentMessage.getReply())
if result is None:
return False
results = result.groupdict()
for captureGroup in results:
story.variables[captureGroup] = results[captureGroup]
logger.critical("Regex not implemented yet")
# return True
return False
if 'contains' in self.vars:

View file

@ -33,6 +33,7 @@ class Player:
def get_output_idx(self):
output_device_idx = None
output_device_idx = 14
devices_count = self.p.get_device_count()
for i in range(devices_count):
dev = self.p.get_device_info_by_index(i)

2
local

@ -1 +1 @@
Subproject commit 71d7b7e1d6a4f4cb1503b845ebb44c4357d42180
Subproject commit e799809a59522d0f68f99f668a9ddf0f5f629912