@caseywebb/growhaus-server
Advanced tools
Comparing version 1.0.0-alpha.156 to 1.0.0-alpha.158
@@ -10,3 +10,2 @@ import * as WebSocket from 'ws'; | ||
private setBrightness; | ||
private setBrightnessViaWeather; | ||
} | ||
@@ -13,0 +12,0 @@ declare class AgentRegistry extends Subscribable { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const autobind_decorator_1 = tslib_1.__importDefault(require("autobind-decorator")); | ||
const brightness_1 = require("./brightness"); | ||
const growhaus_1 = require("@caseywebb/growhaus"); | ||
const weather_1 = require("./weather"); | ||
class Agent extends growhaus_1.Subscribable { | ||
@@ -20,6 +18,5 @@ constructor(name, socket) { | ||
}); | ||
this.setBrightnessViaWeather(); | ||
weather_1.weather.subscribe(this.setBrightnessViaWeather); | ||
brightness_1.brightness.subscribe(() => this.setBrightness(brightness_1.brightness.current)); | ||
} | ||
setBrightness(brightness, duration = 5) { | ||
setBrightness(brightness) { | ||
console.log(`Setting "${this.name}" to ${brightness}% brightness`); | ||
@@ -30,13 +27,6 @@ this.pending = true; | ||
brightness, | ||
duration | ||
})); | ||
this.next(); | ||
} | ||
setBrightnessViaWeather() { | ||
this.setBrightness(weather_1.weather.current.brightness, weather_1.weather.reloadIntervalDurationMinutes); | ||
} | ||
} | ||
tslib_1.__decorate([ | ||
autobind_decorator_1.default | ||
], Agent.prototype, "setBrightnessViaWeather", null); | ||
class AgentRegistry extends growhaus_1.Subscribable { | ||
@@ -43,0 +33,0 @@ constructor() { |
@@ -7,3 +7,2 @@ "use strict"; | ||
const agents_1 = require("./agents"); | ||
const weather_1 = require("./weather"); | ||
exports.websocketRoutes = [ | ||
@@ -18,14 +17,8 @@ route.all('/agent/:name', (ctx, name) => { | ||
event: growhaus_1.WebApiEvents.AgentData, | ||
data: agents_1.agents | ||
data: agents_1.agents, | ||
}); | ||
const sendWeatherData = () => send({ | ||
event: growhaus_1.WebApiEvents.WeatherData, | ||
data: weather_1.weather | ||
}); | ||
sendAgentData(); | ||
sendWeatherData(); | ||
agents_1.agents.subscribe(sendAgentData); | ||
weather_1.weather.subscribe(sendWeatherData); | ||
}) | ||
}), | ||
]; | ||
//# sourceMappingURL=api.js.map |
export declare const PORT: number; | ||
export declare const DARK_SKY_API_KEY: string; | ||
export declare const DARK_SKY_LOCATION: string; | ||
//# sourceMappingURL=config.d.ts.map |
@@ -10,4 +10,2 @@ "use strict"; | ||
: 8081; | ||
exports.DARK_SKY_API_KEY = process.env.DARK_SKY_API_KEY; | ||
exports.DARK_SKY_LOCATION = process.env.DARK_SKY_LOCATION; | ||
//# sourceMappingURL=config.js.map |
{ | ||
"name": "@caseywebb/growhaus-server", | ||
"version": "1.0.0-alpha.156+fd197ac", | ||
"version": "1.0.0-alpha.158+f7e8d53", | ||
"author": "Casey Webb (https://caseyWebb.xyz)", | ||
@@ -17,4 +17,3 @@ "license": "WTFPL", | ||
"dependencies": { | ||
"@caseywebb/growhaus": "^1.0.0-alpha.156+fd197ac", | ||
"autobind-decorator": "^2.4.0", | ||
"@caseywebb/growhaus": "^1.0.0-alpha.158+f7e8d53", | ||
"dotenv": "^8.2.0", | ||
@@ -24,3 +23,2 @@ "koa": "^2.10.0", | ||
"koa-websocket": "^6.0.0", | ||
"node-fetch": "^2.6.0", | ||
"tslib": "^1.10.0" | ||
@@ -34,3 +32,2 @@ }, | ||
"@types/node": "^13.13.4", | ||
"@types/node-fetch": "^2.5.2", | ||
"concurrently": "^5.2.0", | ||
@@ -40,3 +37,3 @@ "nodemon": "^2.0.3", | ||
}, | ||
"gitHead": "fd197ac53f11ade03eee120f41920928bb1d9ca9" | ||
"gitHead": "f7e8d53a2b7cf64b30cd8500511e52e9657c4df3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
6
8
3
14870
185
- Removedautobind-decorator@^2.4.0
- Removednode-fetch@^2.6.0
- Removedautobind-decorator@2.4.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)