Skip to content

Commit 061df61

Browse files
authored
Merge pull request #101 from Cigaes/option_ip
2 parents 071f9c0 + 2855119 commit 061df61

File tree

4 files changed

+6507
-23
lines changed

4 files changed

+6507
-23
lines changed

cli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ program
102102
.description('mock a Tuya device for local testing')
103103
.option('-i, --id [id]', 'ID to use for mock device')
104104
.option('-k, --key [key]', 'key to use for mock device')
105+
.option('-a, --ip <host>', 'IP/host name to use for mock device', 'localhost')
105106
.option('-s, --state [state]', 'inital state to use for device', JSON.stringify({1: true, 2: false}))
106107
.option('-u, --disableUDP', 'disable the UDP broadcast')
107108
.action(options => {

lib/mock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async function mock(config, options) {
1111
}
1212

1313
// Create stub device
14-
const device = new Stub({id: options.id, key: options.key, state: JSON.parse(options.state)});
14+
const device = new Stub({id: options.id, key: options.key, ip: options.ip, state: JSON.parse(options.state)});
1515

1616
// Start stub server
1717
await device.startServer();

0 commit comments

Comments
 (0)