Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

homebridge-air

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-air - npm Package Compare versions

Comparing version 1.0.0-beta.5 to 1.0.0-beta.6

37

dist/devices/airqualitysensor.js

@@ -116,15 +116,28 @@ import { interval } from 'rxjs';

if (url) {
const { body, statusCode } = await request(url);
const response = await body.json();
await this.debugWarnLog(`statusCode: ${JSON.stringify(statusCode)}`);
await this.debugLog(`response: ${JSON.stringify(response)}`);
if (statusCode !== 200) {
this.errorLog(`${this.device.provider === 'airnow' ? 'AirNow' : 'World Air Quality Index'} air quality Network or Unknown Error from %s.`, this.device.provider);
this.AirQualitySensor.StatusFault = this.hap.Characteristic.StatusFault.GENERAL_FAULT;
await this.debugLog(`Error: ${JSON.stringify(response)}`);
await this.apiError(response);
try {
const { body, statusCode } = await request(url);
let response;
try {
response = await body.json();
}
catch (jsonError) {
this.errorLog(`Failed to parse JSON response: ${jsonError.message}`);
this.errorLog(`Raw response body: ${await body.text()}`);
throw jsonError;
}
await this.debugWarnLog(`statusCode: ${JSON.stringify(statusCode)}`);
await this.debugLog(`response: ${JSON.stringify(response)}`);
if (statusCode !== 200) {
this.errorLog(`${this.device.provider === 'airnow' ? 'AirNow' : 'World Air Quality Index'} air quality Network or Unknown Error from %s.`, this.device.provider);
this.AirQualitySensor.StatusFault = this.hap.Characteristic.StatusFault.GENERAL_FAULT;
await this.debugLog(`Error: ${JSON.stringify(response)}`);
await this.apiError(response);
}
else {
this.deviceStatus = this.device.provider === 'aqicn' ? response.data : response;
await this.parseStatus();
}
}
else {
this.deviceStatus = this.device.provider === 'aqicn' ? response.data : response;
await this.parseStatus();
catch (error) {
this.errorLog(`Request failed: ${error.message}`);
}

@@ -131,0 +144,0 @@ }

@@ -5,3 +5,3 @@ {

"type": "module",
"version": "1.0.0-beta.5",
"version": "1.0.0-beta.6",
"description": "The AirNow plugin allows you to monitor the current AirQuality for your Zip Code from HomeKit and Siri.",

@@ -8,0 +8,0 @@ "author": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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