Skip to content

Commit

Permalink
Fix util._extend warning
Browse files Browse the repository at this point in the history
Fix #303  Though I could not reproduce the warning, this should fix it.
  • Loading branch information
dacarson committed Dec 5, 2024
1 parent 0a6c1e2 commit c368637
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 5 additions & 7 deletions util/characteristics.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c368637

Please sign in to comment.