tplink-cloud-api icon indicating copy to clipboard operation
tplink-cloud-api copied to clipboard

HS103 Support

Open PrabhanshuAttri opened this issue 6 years ago • 4 comments

Hi @adumont

First of all, thank you for creating this library. I noticed that it doesn't contain support for HS103. I looked through the code and found a way to do it. HS100 class can be used to toggle the device.

Here is the code for HS103 to toggle the device.

const deviceFound = await tplink.findDevice(deviceName);
const hs103Device = new HS100(tplink, deviceFound);
await hs103Device.toggle();

I think if all devices in tplink.ts are exported (hs100, hs110, hs200, etc), the package can support more devices.

Let me know if you want me to work on this.

PrabhanshuAttri avatar Mar 25 '20 01:03 PrabhanshuAttri

This repo doesn't get updated all that often

ColinMcNeil avatar Mar 25 '20 03:03 ColinMcNeil

Sorry about that. If anyone pushes pull request, I'll gladly merge then and update the npm.

El mié., 25 mar. 2020 4:22, Colin McNeil [email protected] escribió:

This repo doesn't get updated all that often

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adumont/tplink-cloud-api/issues/35#issuecomment-603618449, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRLWUROAVMPTXIW4TRMPTRJF2H5ANCNFSM4LTDGPBQ .

adumont avatar Mar 25 '20 21:03 adumont

Hi @PrabhanshuAttri , if the HS100 class works, why do you need a new class?

adumont avatar Jun 06 '20 18:06 adumont

If HS100 is exported then this repository can support more devices. Currently, importing HS100 is kinda ugly and not dev friendly.

const __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};

const hs100 = __importDefault(require('./node_modules/tplink-cloud-api/distribution/hs100.js'));

PrabhanshuAttri avatar Jun 08 '20 18:06 PrabhanshuAttri