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
798adf6c
Commit
798adf6c
authored
Mar 17, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pushAnalog to make it push only one analog input per POST
parent
18f42aeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
boardtype.py
domotika/boards/boardtype.py
+3
-1
No files found.
domotika/boards/boardtype.py
View file @
798adf6c
...
...
@@ -350,6 +350,7 @@ class ANABoard(object):
postdata
+=
normalize
(
a
[
k
])
uri
=
"http://"
+
self
.
host
+
":"
+
str
(
self
.
port
)
+
"/ioconf.xml"
log
.
info
(
"Posting Analog config to "
+
str
(
uri
))
log
.
info
(
postdata
)
return
self
.
requestPage
(
uri
,
method
=
'POST'
,
postdata
=
postdata
,
nolocation
=
True
)
.
addCallbacks
(
endPush
,
endPush
)
...
...
@@ -359,7 +360,7 @@ class ANABoard(object):
if
not
bname
:
boardname
=
str
(
xml
.
getElementsByTagName
(
self
.
boardXML
,
'cfg_hostname'
)[
0
]
.
firstChild
()
.
toxml
())
#sqlstring="SELECT * FROM ioconf_analogs WHERE boardname='%s' AND boardip='%s'" % (boardname, boardip)
sqlstring
=
"boardname='
%
s' AND boardip='
%
s'
"
%
(
boardname
,
boardip
)
sqlstring
=
"boardname='
%
s' AND boardip='
%
s'
and ananum='
%
s'"
%
(
boardname
,
boardip
,
str
(
num
)
)
if
genutils
.
is_number
(
status
)
and
status
!=
'*'
:
sqlstring
+=
" AND status_num='
%
s'"
%
str
(
status
)
elif
status
!=
'*'
:
...
...
@@ -368,6 +369,7 @@ class ANABoard(object):
return
dmdb
.
IOConfAnalogs
.
find
(
where
=
[
sqlstring
])
.
addCallback
(
self
.
_sendAnalogIOConf
,
dataonly
)
def
_pushAnalog
(
self
,
num
,
status
,
dataonly
=
False
,
bname
=
False
):
log
.
info
(
'PUSH ANALOG NUMBER '
+
str
(
num
))
self
.
analogLock
=
True
if
not
bname
and
not
self
.
initialized
:
return
self
.
initialize
()
.
addCallback
(
self
.
_getAnalogIOConf
,
num
,
status
,
dataonly
,
bname
)
...
...
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