Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
ab35b815fb
|
|||
ec3fb5c72c
|
|||
9da6eab743
|
@ -28,7 +28,7 @@ dockerize:
|
||||
- tags
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
CONTAINER_NAME: level-preprocessor
|
||||
CONTAINER_NAME: cem-preprocessor
|
||||
script:
|
||||
- docker stop $CONTAINER_NAME || echo "container not running, never mind"
|
||||
- docker rm $CONTAINER_NAME || echo "container not existing, never mind"
|
||||
|
@ -100,14 +100,14 @@ def splitTopic(topic):
|
||||
except ValueError:
|
||||
raise InvalidTopicException(topic)
|
||||
r = rest.split('/')
|
||||
if (len(r) == 1:
|
||||
if (len(r) == 1):
|
||||
deviceId = 'mains',
|
||||
variableId = r[0]
|
||||
elif (len(r) == 2:
|
||||
(deviceId, variableid) = r
|
||||
elif (len(r) == 2):
|
||||
(deviceId, variableId) = r
|
||||
else:
|
||||
raise InvalidTopicException(topic)
|
||||
return (appId, converterId, deviceId, variableid)
|
||||
return (appId, converterId, deviceId, variableId)
|
||||
|
||||
def mqttOnConnectCallback(client, userdata, flags, rc):
|
||||
logger.info("mqtt connected")
|
||||
@ -124,7 +124,7 @@ def mqttOnMessageCallback(client, userdata, message):
|
||||
(appId, converterId, deviceId, variableId) = splitTopic(topic)
|
||||
|
||||
dbh = DbOp(config)
|
||||
variable = dbh.getVariable(appId, converterId, deviceId, variableid)
|
||||
variable = dbh.getVariable(appId, converterId, deviceId, variableId)
|
||||
measurement = {
|
||||
"application": variable["application"],
|
||||
"variable": variable["variable"],
|
||||
|
Reference in New Issue
Block a user