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",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"prepare": "tsc -p .",
|
||||
"build": "esbuild src/main.ts --bundle --outfile=dist/bundle.js --platform=node",
|
||||
"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',
|
||||
choices: ['list', 'sunrise', 'sunset'],
|
||||
},
|
||||
{
|
||||
name: '--status',
|
||||
description: 'filter results by status',
|
||||
type: 'string',
|
||||
choices: ['', 'on', 'off'],
|
||||
default: '',
|
||||
nargs: '?',
|
||||
},
|
||||
{
|
||||
name: '--maxwait',
|
||||
description: 'max time in ms to wait for all addresses to respond',
|
||||
|
|
@ -80,8 +72,7 @@ const sunrise3 = (light: LLight) => {
|
|||
0, // saturation
|
||||
100, // brightness
|
||||
3300, // Kelvin
|
||||
// 5 * 60 * 1000, // 5 minutes in ms
|
||||
3000,
|
||||
5 * 60 * 1000, // 5 minutes in ms
|
||||
next,
|
||||
)
|
||||
}
|
||||
|
|
@ -103,12 +94,12 @@ const sunrise4 = (light: LLight) => {
|
|||
emitter.on('discovery-stop', () => {
|
||||
switch (args.positional.command) {
|
||||
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}`);
|
||||
}
|
||||
break;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue