import { Color } from "./color" ; import { SceneType , StartFlowAction } from "./enums" ; import { FlowState } from "./flow-state" ; export class Scene { constructor ( public type ) { } public getData ( ) { return null ; } } export class ColorScene extends Scene { constructor ( public color , public bright ) { super ( SceneType . COLOR ) ; } public getData ( ) { return [ this . type , this . color . getValue ( ) , this . bright ] ; } } export class HsvScene extends Scene { constructor ( public hue , public satuation , public brightness ) { super ( SceneType . HSV ) ; } public getData ( ) { return [ this . type , this . hue , this . satuation , this . brightness ] ; } } /**
 * change the smart LED to specified ct and brightness
 */ export class CtScene extends Scene { constructor param temperature param brightness constructor ( public temperature , public brightness ) { super ( SceneType . CT ) ; } public getData ( ) { return [ this . type , this . temperature , this . brightness ] ; } } export class CfScene extends Scene { constructor param flowAction param states param repeat constructor ( public flowAction , public states , public repeat ) { super ( SceneType . CF ) ; } public getData ( ) { const list = this . states . reduce ( ( a , b ) => [ ... a , ... b . getState ( ) ] , [ ] ) ; return [ this . type , this . repeat , this . flowAction , list . join ( "," ) ] ; } }