Closed snowdd1 closed 4 years ago
For the time being I monkey-patched lib/plug/index.js #352-382
try {
//data = await this.sendCommand('{"emeter":{"get_realtime":{}},"schedule":{"get_next_action":{}},"system":{"get_sysinfo":{}},"cnCloud":{"get_info":{}}}', this.childId, sendOptions);
data = await this.sendCommand('{"system":{"get_sysinfo":{}},"cnCloud":{"get_info":{}}}', this.childId, sendOptions);
} catch (err) {
// Ignore emeter section errors as not all devices support it
if (err instanceof ResponseError && err.errorModules.length === 1 && err.errorModules[0] === 'emeter') {
data = err.response;
} else {
throw err;
}
}
this.sysInfo = data.system.get_sysinfo;
this.cloud.info = data.cnCloud.get_info;
// if (Object.prototype.hasOwnProperty.call(data.emeter, 'get_realtime')) {
// this.emeter.realtime = data.emeter.get_realtime;
// }
// this.schedule.nextAction = data.schedule.get_next_action;
return {
sysInfo: this.sysInfo,
cloud: {
info: this.cloud.info
// },
// emeter: {
// realtime: this.emeter.realtime
// },
// schedule: {
// nextAction: this.schedule.nextAction
}
};
to remove support for EMETER and schedule which I don't use anyway. I saw that the EMETER error has been excluded by hardwiring already, maybe the "time not in sync" could be handled similarly, or a new option in getPlug() to fix it to a type, and a range of feature you want to use/support.
Can be closed. I found out that setting the time is no active process, but the plug queries the internet for a time server. So I will allow the firewall to talk to one of the time servers the plug is querying.
Hi platicrake, I am using my HS100 locally (no internet connect, no cloud) via API only, but I found that the API is failing if the time and location are not set, and the plug is queried using client.getPlug(host: name). Not sure about location though, 0/0 could be good. Is there a way to set time after a power outage, except manually via the KASA app?
Funny thing: using an older version and full discovery it still works, only my new program with the new version of the API fails. I don't know exactly which version the old one had, but could look it up if it is of interest to you.
Thanks!
{"err_code":-11,"err_msg":"time not sync"}
in