-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: turn on @typescript-eslint/strict-type-checked
Enable rule and associated fixes. I think a lot of small bugs may have been squashed
- Loading branch information
1 parent
a8dd13d
commit 213fcde
Showing
35 changed files
with
769 additions
and
587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { Client, Sysinfo } from '..'; // 'tplink-smarthome-api' | ||
import { Client } from '..'; // 'tplink-smarthome-api' | ||
|
||
const client = new Client(); | ||
|
||
client.getDevice({ host: '10.0.0.60' }).then((device) => { | ||
device.getSysInfo().then((sysInfo: Sysinfo) => console.log(sysInfo)); | ||
}); | ||
client | ||
.getDevice({ host: '10.0.0.60' }) | ||
.then(async (device) => { | ||
const sysInfo = await device.getSysInfo(); | ||
console.log(sysInfo); | ||
}) | ||
.catch((reason) => { | ||
console.error(reason); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import { Client } from '..'; // 'tplink-smarthome-api' | ||
import { Client, Plug } from '..'; // 'tplink-smarthome-api' | ||
|
||
const client = new Client(); | ||
|
||
// Search for all plugs and turn them on | ||
client.on('plug-new', (plug) => { | ||
client.on('plug-new', (plug: Plug) => { | ||
console.log('Found plug:', plug.alias); | ||
plug.setPowerState(true).then(() => { | ||
console.log('Plug', plug.alias, 'is now on'); | ||
}); | ||
plug | ||
.setPowerState(true) | ||
.then(() => { | ||
console.log('Plug', plug.alias, 'is now on'); | ||
}) | ||
.catch((reason) => { | ||
console.error(reason); | ||
}); | ||
}); | ||
|
||
client.startDiscovery(); |
Oops, something went wrong.