hi @bertabcd1234 thanks for the response! no VLANs or network weirdness, just one flat L2 network.
yes its strange that the 'status' Callback handler method for (sync)httpGet seems to work (getResp.status yields 404), when the hubitat method documentation for asyncHttpGet states that the correct status method is getResp.getStatus() which doesn't work. could there be some level of "incompleteness" in the implementation of the async vs the 'traditional' sync httpGet methods?
tbh i'll use whatever method works for status, though, as long as the basic calls can be made to work.
the device is a wifi air-con unit adapter. there is an existing driver that uses sync calls, which doesn't work in a lot of ways, and i've been needing to re-write it for some time to fix a lot of the issues, as well as make it more efficient (one example, async vs sync calls to prevent any process delays).
so my approach is to get the api calls working, and focus on driver logic & features from there.
my callback looks like:
def getHandler(getResp, data) {
if (debugOutput) { log.debug "getHandler: response status: {$getResp.status}" }
//if (debugOutput) { log.debug "getHandler: getResp.data: {$getResp.data}" }
getResp.properties.each {
log.trace (it)
}
try {
if (getResp.getStatus() == 200) {
//do stuff
}
else {
log.debug "getHandler: asynchttp error {$getResp.getStatus}"
//do stuff?
}
} catch(e) {
log.debug "getHandler: Asynchttp call unsuccessful: {$e}"
//do stuff?
if(getResp.hasError()) {
log.warn (getResp.getErrorMessage())
}
}