init
composition of async path of actions is a little silly, will hopefully get around to a nicer way to do it. sunset is still todo, moving to build & deployment first.
This commit is contained in:
commit
61e88054eb
9 changed files with 564 additions and 0 deletions
51
src/overrides.ts
Normal file
51
src/overrides.ts
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* Because Nothing can be perfect
|
||||
**/
|
||||
|
||||
import { Client, Light } from 'lifx-lan-client';
|
||||
import { EventEmitter } from 'eventemitter3'
|
||||
|
||||
class LifxClient extends Client {
|
||||
lightAddresses!: Array<string>;
|
||||
|
||||
stopDiscovery() {
|
||||
super.stopDiscovery();
|
||||
((this as unknown) as EventEmitter).emit('discovery-stop');
|
||||
}
|
||||
|
||||
startDiscovery(lights: any) {
|
||||
super.startDiscovery(lights);
|
||||
((this as unknown) as EventEmitter).emit('discovery-start');
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
((this as unknown) as EventEmitter).removeAllListeners();
|
||||
super.destroy();
|
||||
}
|
||||
};
|
||||
|
||||
class LLight extends Light {
|
||||
id!: string;
|
||||
label!: string;
|
||||
address!: string;
|
||||
};
|
||||
|
||||
interface LColor {
|
||||
hue: number,
|
||||
saturation: number,
|
||||
brightness: number,
|
||||
kelvin: number,
|
||||
}
|
||||
|
||||
interface LState {
|
||||
color: LColor,
|
||||
power: number,
|
||||
label: string,
|
||||
}
|
||||
|
||||
export {
|
||||
LifxClient,
|
||||
LLight,
|
||||
LColor,
|
||||
LState,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue