last minute cleanup
This commit is contained in:
parent
103cc19238
commit
9f7d0fcb9d
2 changed files with 3 additions and 13 deletions
|
|
@ -4,7 +4,6 @@
|
||||||
"description": "Simple LIFX lights automation scripts",
|
"description": "Simple LIFX lights automation scripts",
|
||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "tsc -p .",
|
|
||||||
"build": "esbuild src/main.ts --bundle --outfile=dist/bundle.js --platform=node",
|
"build": "esbuild src/main.ts --bundle --outfile=dist/bundle.js --platform=node",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
15
src/main.ts
15
src/main.ts
|
|
@ -15,14 +15,6 @@ const parser = new ArgsParser({
|
||||||
type: 'string',
|
type: 'string',
|
||||||
choices: ['list', 'sunrise', 'sunset'],
|
choices: ['list', 'sunrise', 'sunset'],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: '--status',
|
|
||||||
description: 'filter results by status',
|
|
||||||
type: 'string',
|
|
||||||
choices: ['', 'on', 'off'],
|
|
||||||
default: '',
|
|
||||||
nargs: '?',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: '--maxwait',
|
name: '--maxwait',
|
||||||
description: 'max time in ms to wait for all addresses to respond',
|
description: 'max time in ms to wait for all addresses to respond',
|
||||||
|
|
@ -80,8 +72,7 @@ const sunrise3 = (light: LLight) => {
|
||||||
0, // saturation
|
0, // saturation
|
||||||
100, // brightness
|
100, // brightness
|
||||||
3300, // Kelvin
|
3300, // Kelvin
|
||||||
// 5 * 60 * 1000, // 5 minutes in ms
|
5 * 60 * 1000, // 5 minutes in ms
|
||||||
3000,
|
|
||||||
next,
|
next,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -103,12 +94,12 @@ const sunrise4 = (light: LLight) => {
|
||||||
emitter.on('discovery-stop', () => {
|
emitter.on('discovery-stop', () => {
|
||||||
switch (args.positional.command) {
|
switch (args.positional.command) {
|
||||||
case 'list':
|
case 'list':
|
||||||
for (const [_, value] of Object.entries(client.lights(args.options.status))) {
|
for (const [_, value] of Object.entries(client.lights(''))) {
|
||||||
console.log(`${(value as LLight).id}: ${(value as LLight).label}`);
|
console.log(`${(value as LLight).id}: ${(value as LLight).label}`);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'sunrise':
|
case 'sunrise':
|
||||||
for (const [_, value] of Object.entries(client.lights(args.options.status))) {
|
for (const [_, value] of Object.entries(client.lights(''))) {
|
||||||
sunrise1(value as LLight);
|
sunrise1(value as LLight);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue