diff --git a/CHANGELOG.md b/CHANGELOG.md index 8903e69..67795e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -299,4 +299,4 @@ ## 3.3.6 * The fix in 3.3.4 for tile naming in Home app was not supported with HomeBridge. Add setting of Name property back for HomeBridge compatibility. * Fix issue with threshold triggers and WeatherUnderground. In 3.3.4, WeatherUnderground API call was modified and incorrectly return values in km, and km/h. -* Fix punycode deprication warning. +* Fix punycode deprication warning and util._extend warning. diff --git a/package.json b/package.json index 71ace0a..f4e6604 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,6 @@ "fakegato-history": "^0.6.4", "geo-tz": "^6.0.0", "moment-timezone": "^0.5.28", - "underscore": "^1.13.6", "request": "^2.88.2", "weather-formulas": "^1", "node-persist": "^2.1.0", diff --git a/util/characteristics.js b/util/characteristics.js index 9f0587d..03f0488 100644 --- a/util/characteristics.js +++ b/util/characteristics.js @@ -1,7 +1,5 @@ /* jshint asi: true, esversion: 6, laxbreak: true, laxcomma: true, node: true, undef: true, unused: true */ -const underscore = require('underscore'); - const inherits = require('util').inherits, CustomUUID = { // Eve UUID @@ -69,7 +67,7 @@ module.exports = function (Characteristic, units) var range = (units !== 'imperial') ? {unit: 'mm', maxValue: max, minValue: 0, minStep: 0.1} : {unit: 'in', maxValue: Math.round(max / 25.4), minValue: 0, minStep: 0.01}; - return underscore.extend( + return Object.assign( { format: Characteristic.Formats.FLOAT , perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY] @@ -90,7 +88,7 @@ module.exports = function (Characteristic, units) minValue: temperatureValue(min), maxValue: temperatureValue(max)}; - return underscore.extend( + return Object.assign( { format: Characteristic.Formats.FLOAT , minStep: 0.1 @@ -107,7 +105,7 @@ module.exports = function (Characteristic, units) var range = ((units === 'si') || (units === 'sitorr') || (units === 'ca')) ? {unit: 'km', maxValue: max, minValue: 0} : {unit: 'mi', maxValue: km2mi(max), minValue: 0}; - return underscore.extend( + return Object.assign( { format: Characteristic.Formats.UINT8 , minStep: 1 @@ -133,7 +131,7 @@ module.exports = function (Characteristic, units) : (units === 'ca') ? {unit: 'km/h', maxValue: mtos2kmh(max), minValue: 0} : {unit: 'mph', maxValue: mtos2mih(max), minValue: 0}; - return underscore.extend( + return Object.assign( { format: Characteristic.Formats.UINT8 , minStep: 0.1 @@ -156,7 +154,7 @@ module.exports = function (Characteristic, units) let range = (units === 'sitorr') ? {unit: 'mmhg', maxValue: hpa2mmhg(max), minValue: hpa2mmhg(min)} : {unit: 'hPa', maxValue: max, minValue: min}; - return underscore.extend( + return Object.assign( { format: Characteristic.Formats.UINT16 , minStep: 1