New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

homebridge-weather

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-weather - npm Package Compare versions

Comparing version 1.6.7 to 1.7.0

20

index.js

@@ -157,5 +157,19 @@ "use strict";

if (this.type === "min") {
temperature = parseFloat(this.cachedWeatherObj["list"][0]["temp"]["min"]);
// Unfortunately we cannot use the "16 day weather forecast" API but the "5 day / 3 hour forecast" instead.
// this API gives one min/max every 3 hours but we want the daily min/max so we have to iterate over all those data
var min = parseFloat(this.cachedWeatherObj["list"][0]["main"]["temp_min"]);
for (var i = 0, len = this.cachedWeatherObj["list"].length; i < len; i++) {
if (parseFloat(this.cachedWeatherObj["list"][i]["main"]["temp_min"]) < min) {
min = parseFloat(this.cachedWeatherObj["list"][i]["main"]["temp_min"]);
}
}
temperature = min;
} else if (this.type === "max") {
temperature = parseFloat(this.cachedWeatherObj["list"][0]["temp"]["max"]);
var max = parseFloat(this.cachedWeatherObj["list"][0]["main"]["temp_max"]);
for (var i = 0, len = this.cachedWeatherObj["list"].length; i < len; i++) {
if (parseFloat(this.cachedWeatherObj["list"][i]["main"]["temp_max"]) > max) {
max = parseFloat(this.cachedWeatherObj["list"][i]["main"]["temp_max"]);
}
}
temperature = max;
} else {

@@ -184,3 +198,3 @@ temperature = parseFloat(this.cachedWeatherObj["main"]["temp"]);

// Min-/Max-sensors have different endpoint
url += "forecast/daily"
url += "forecast"
}

@@ -187,0 +201,0 @@

2

package.json
{
"name": "homebridge-weather",
"version": "1.6.7",
"version": "1.7.0",
"description": "Homebridge plugin for displaying the weather from openweathermap.org",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc