@caseywebb/growhaus-agent
Advanced tools
Comparing version 0.0.0-latest.20190729T210658Z.8d4c964 to 0.0.0-latest.20190729T210722Z.d2c59fa
@@ -18,4 +18,3 @@ "use strict"; | ||
}); | ||
socket.on(socket_1.IncomingEvent.OfflineSchedule, (s) => offlineFallbackSchedule.set(s.schedule)); | ||
offlineFallbackSchedule.subscribe(driver.setBrightness); | ||
} |
@@ -8,3 +8,2 @@ export declare class LightSchedule { | ||
pause(duration: number): void; | ||
set(schedule: number[]): void; | ||
subscribe(handler: (b: number) => void): void; | ||
@@ -11,0 +10,0 @@ private getCurrentBrightness; |
@@ -47,8 +47,5 @@ "use strict"; | ||
} | ||
set(schedule) { | ||
this.schedule = schedule; | ||
this.next(); | ||
} | ||
subscribe(handler) { | ||
this.subscriptions.push(handler); | ||
this.next(); | ||
} | ||
@@ -55,0 +52,0 @@ getCurrentBrightness() { |
export declare enum IncomingEvent { | ||
Brightness = "brightness", | ||
OfflineSchedule = "schedule" | ||
Brightness = "brightness" | ||
} | ||
@@ -10,6 +9,2 @@ export declare type ManualBrightnessMessage = { | ||
}; | ||
export declare type OfflineScheduleMessage = { | ||
event: IncomingEvent.OfflineSchedule; | ||
schedule: number[]; | ||
}; | ||
/** | ||
@@ -24,3 +19,2 @@ * Wrapper that adds type information and deals with connection persistence | ||
constructor(url: string); | ||
on(eventType: IncomingEvent.OfflineSchedule, handler: (m: OfflineScheduleMessage) => void): void; | ||
on(eventType: IncomingEvent.Brightness, handler: (m: ManualBrightnessMessage) => void): void; | ||
@@ -27,0 +21,0 @@ private connect; |
@@ -9,3 +9,2 @@ "use strict"; | ||
IncomingEvent["Brightness"] = "brightness"; | ||
IncomingEvent["OfflineSchedule"] = "schedule"; | ||
})(IncomingEvent = exports.IncomingEvent || (exports.IncomingEvent = {})); | ||
@@ -19,3 +18,2 @@ /** | ||
this.onMessageHandlers = { | ||
[IncomingEvent.OfflineSchedule]: [], | ||
[IncomingEvent.Brightness]: [] | ||
@@ -22,0 +20,0 @@ }; |
{ | ||
"name": "@caseywebb/growhaus-agent", | ||
"version": "0.0.0-latest.20190729T210658Z.8d4c964", | ||
"version": "0.0.0-latest.20190729T210722Z.d2c59fa", | ||
"author": "Casey Webb (https://caseyWebb.xyz)", | ||
@@ -5,0 +5,0 @@ "bin": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9734
229