Closed benepixx closed 2 years ago
Hi, I think im being a moron, but hoping someone can show me where Im going wrong:
State is returned as "table.DisableLinkage.Enable=true" (Or false dependant on state)
Ive got a regex and a static mapper them but the debug output just shows the mappers passing the whole thing on to the next mapper.
See output:
28/05/2022, 11:05:11] [CCTV Alarm] Mapper 0 mapped table.DisableLinkage.Enable=false to table.DisableLinkage.Enable=false
[28/05/2022, 11:05:11] [CCTV Alarm] Mapper 1 mapped table.DisableLinkage.Enable=false to table.DisableLinkage.Enable=false
See attached section of mapper config.
"readCurrentState": { "url": "http://192.168.10.11/cgi-bin/configManager.cgi?action=getConfig&name=DisableLinkage", "body": "" }, "readTargetState": { "url": "http://192.168.10.11/cgi-bin/configManager.cgi?action=getConfig&name=DisableLinkage", "body": "" } }, "mappers": [ { "type": "regex", "parameters": { "regexp": "\"Enable=\": (\\d)" } }, { "type": "static", "parameters": { "mapping": { "false": "0", "true": "3" } } } ] }
Can anyone tell me where im going wrong?
Nevermind. my Regex was miles off. (?:(false|true)) Works perfectly.
Good job sorting it out yourself :)
Hi, I think im being a moron, but hoping someone can show me where Im going wrong:
State is returned as "table.DisableLinkage.Enable=true" (Or false dependant on state)
Ive got a regex and a static mapper them but the debug output just shows the mappers passing the whole thing on to the next mapper.
See output:
28/05/2022, 11:05:11] [CCTV Alarm] Mapper 0 mapped table.DisableLinkage.Enable=false to table.DisableLinkage.Enable=false
[28/05/2022, 11:05:11] [CCTV Alarm] Mapper 1 mapped table.DisableLinkage.Enable=false to table.DisableLinkage.Enable=false
See attached section of mapper config.
"readCurrentState": { "url": "http://192.168.10.11/cgi-bin/configManager.cgi?action=getConfig&name=DisableLinkage", "body": "" }, "readTargetState": { "url": "http://192.168.10.11/cgi-bin/configManager.cgi?action=getConfig&name=DisableLinkage", "body": "" } }, "mappers": [ { "type": "regex", "parameters": { "regexp": "\"Enable=\": (\\d)" } }, { "type": "static", "parameters": { "mapping": { "false": "0", "true": "3" } } } ] }
Can anyone tell me where im going wrong?