Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
domotikad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
domotika
domotikad
Commits
e16621c6
Commit
e16621c6
authored
Jan 28, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Few fixes on sequence conditions
parent
d6035ba8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
domotika.py
domotika/domotika.py
+6
-5
No files found.
domotika/domotika.py
View file @
e16621c6
...
...
@@ -1104,19 +1104,19 @@ class domotikaService(service.Service):
if
st
[
1
]
==
'domain'
:
try
:
ret
=
doQuery
(
"""SELECT COUNT(value) FROM statusrealtime
WHERE DMDOMAIN(status_name,
"""
+
str
(
st
[
0
])
+
"
)=1 AND DMDOMAIN(value,'"
+
st
[
'2'
]
+
"')=1"
,
restype
)
WHERE DMDOMAIN(status_name,
'"""
+
str
(
st
[
0
])
+
"'
)=1 AND DMDOMAIN(value,'"
+
st
[
'2'
]
+
"')=1"
,
restype
)
except
:
pass
elif
genutils
.
is_number
(
st
[
2
]):
try
:
ret
=
doQuery
(
"""SELECT COUNT(value) FROM statusrealtime
WHERE DMDOMAIN(status_name,
"""
+
str
(
st
[
0
])
+
"
)=1 AND CONVERT(value, SIGNED)"
+
st
[
'1'
]
+
st
[
2
],
restype
)
WHERE DMDOMAIN(status_name,
'"""
+
str
(
st
[
0
])
+
"'
)=1 AND CONVERT(value, SIGNED)"
+
st
[
'1'
]
+
st
[
2
],
restype
)
except
:
pass
elif
restype
in
[
'bool'
,
'int'
]
and
len
(
st
)
==
2
and
genutils
.
is_number
(
st
[
1
]):
try
:
ret
=
doQuery
(
"""SELECT COUNT(value) FROM statusrealtime
WHERE DMDOMAIN(status_name,
"""
+
str
(
st
[
0
])
+
"
)=1 AND CONVERT(value, SIGNED)="
+
st
[
'1'
],
restype
)
WHERE DMDOMAIN(status_name,
'"""
+
str
(
st
[
0
])
+
"'
)=1 AND CONVERT(value, SIGNED)="
+
st
[
'1'
],
restype
)
except
:
pass
elif
restype
==
'string'
and
len
(
st
)
>
0
:
...
...
@@ -1133,13 +1133,13 @@ class domotikaService(service.Service):
if
st
[
1
]
==
'domain'
:
try
:
ret
=
doQuery
(
"""SELECT COUNT(value) FROM uniques
WHERE DMDOMAIN(name,
"""
+
str
(
st
[
0
])
+
"
)=1 AND DMDOMAIN(value,'"
+
st
[
'2'
]
+
"')=1"
,
restype
)
WHERE DMDOMAIN(name,
'"""
+
str
(
st
[
0
])
+
"'
)=1 AND DMDOMAIN(value,'"
+
st
[
'2'
]
+
"')=1"
,
restype
)
except
:
pass
elif
genutils
.
is_number
(
st
[
2
]):
try
:
ret
=
doQuery
(
"""SELECT COUNT(value) FROM uniques
WHERE DMDOMAIN(name,
"""
+
str
(
st
[
0
])
+
"
)=1 AND CONVERT(value, SIGNED)"
+
st
[
'1'
]
+
st
[
2
],
restype
)
WHERE DMDOMAIN(name,
'"""
+
str
(
st
[
0
])
+
"'
)=1 AND CONVERT(value, SIGNED)"
+
st
[
'1'
]
+
st
[
2
],
restype
)
except
:
pass
...
...
@@ -1505,6 +1505,7 @@ class domotikaService(service.Service):
return
if
usecon
:
log
.
info
(
"Sequence condition check (RESULT:"
+
str
(
conval
)
+
" CONDITION: "
+
str
(
res
.
condition_act
)
+
" ACTVALUE: "
+
str
(
res
.
condition_actvalue
)
+
")"
)
if
genutils
.
isTrue
(
conval
):
if
res
.
condition_act
==
'GOTOSTEP'
:
if
genutils
.
is_number
(
res
.
condition_actvalue
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment