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

homebridge-platform-wemo

Package Overview
Dependencies
Maintainers
1
Versions
357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-platform-wemo - npm Package Compare versions

Comparing version 3.0.9 to 3.0.10-beta.0

238

CHANGELOG.md

@@ -5,2 +5,9 @@ # Change Log

## BETA
### Changes
- [Backend] Use `standard-prettier` code formatting
- Recommended node version bump to v14.17.0
## 3.0.9 (2021-05-10)

@@ -10,5 +17,5 @@

* Reduce 'No Response' timeout to 2 seconds
* Update the correct corresponding characteristic after the 'No Response' timeout
* Ensure user is using at least Homebridge v1.3.0
- Reduce 'No Response' timeout to 2 seconds
- Update the correct corresponding characteristic after the 'No Response' timeout
- Ensure user is using at least Homebridge v1.3.0

@@ -19,5 +26,5 @@ ## 3.0.8 (2021-05-04)

* Update config schema title and description for 'Manual Devices'
* Accessory 'identify' function will now add an entry to the log
* Backend refactoring, function and variable name changes
- Update config schema title and description for 'Manual Devices'
- Accessory 'identify' function will now add an entry to the log
- Backend refactoring, function and variable name changes

@@ -28,4 +35,4 @@ ## 3.0.7 (2021-04-27)

* Display Wemo Insight 'on time' as HH:MM:SS in logs
* More consistent logging on device errors, and helpful info for common errors
- Display Wemo Insight 'on time' as HH:MM:SS in logs
- More consistent logging on device errors, and helpful info for common errors

@@ -36,3 +43,3 @@ ## 3.0.6 (2021-04-24)

* Fix 'time on' and 'total consumption' calculations for Wemo Insights
- Fix 'time on' and 'total consumption' calculations for Wemo Insights

@@ -43,4 +50,4 @@ ## 3.0.5 (2021-04-16)

* Fix characteristic NaN warning for `LastActivation`
* Update wiki links in the Homebridge plugin-ui
- Fix characteristic NaN warning for `LastActivation`
- Update wiki links in the Homebridge plugin-ui

@@ -51,3 +58,3 @@ ## 3.0.4 (2021-04-14)

* Ensure 'No Response' is removed from Wemo Makers when discovered
- Ensure 'No Response' is removed from Wemo Makers when discovered

@@ -58,3 +65,3 @@ ## 3.0.3 (2021-04-14)

* Fixes a characteristic issue with Wemo Maker devices
- Fixes a characteristic issue with Wemo Maker devices

@@ -65,3 +72,3 @@ ## 3.0.2 (2021-04-13)

* Fix for `Cannot read property 'updateCharacteristic' of undefined` on plugin startup
- Fix for `Cannot read property 'updateCharacteristic' of undefined` on plugin startup

@@ -72,22 +79,23 @@ ## 3.0.1 (2021-04-13)

* **Homebridge Users**
* This plugin has a minimum requirement of Homebridge v1.3.3
- **Homebridge Users**
* **HOOBS Users**
* This plugin has a minimum requirement of HOOBS v3.3.4
- This plugin has a minimum requirement of Homebridge v1.3.3
- **HOOBS Users**
- This plugin has a minimum requirement of HOOBS v3.3.4
### Added
* For auto-discovered devices and devices manually-defined with a full address for which the given port does not work, the port scanner will now check to see if a different port is working and setup the device using this new port
* On Homebridge restart, devices will show as 'No Response' until discovered
* 'No Response' messages for devices if controlled and unsuccessful (and this status will be reverted after 5 seconds)
* Debug log messages showing data sent to devices when controlled
- For auto-discovered devices and devices manually-defined with a full address for which the given port does not work, the port scanner will now check to see if a different port is working and setup the device using this new port
- On Homebridge restart, devices will show as 'No Response' until discovered
- 'No Response' messages for devices if controlled and unsuccessful (and this status will be reverted after 5 seconds)
- Debug log messages showing data sent to devices when controlled
### Changes
* Use the new `.onGet`/`.onSet` methods available in Homebridge v1.3
* Logs will show IP and port on device initiation instead of mac address
* Updated plugin-ui 'Support' page links to match GitHub readme file
* Updated README to reflect minimum supported Homebridge/HOOBS and Node versions
* Updated recommended Node to v14.16.1
- Use the new `.onGet`/`.onSet` methods available in Homebridge v1.3
- Logs will show IP and port on device initiation instead of mac address
- Updated plugin-ui 'Support' page links to match GitHub readme file
- Updated README to reflect minimum supported Homebridge/HOOBS and Node versions
- Updated recommended Node to v14.16.1

@@ -98,5 +106,5 @@ ## 2.15.2 (2021-03-21)

* Correct `debugFakegato` setting to type boolean
* More welcome messages
* Updated `plugin-ui-utils` dependency
- Correct `debugFakegato` setting to type boolean
- More welcome messages
- Updated `plugin-ui-utils` dependency

@@ -107,3 +115,3 @@ ## 2.15.1 (2021-03-17)

* Modified config schema to show titles/descriptions for non Homebridge UI users
- Modified config schema to show titles/descriptions for non Homebridge UI users

@@ -114,13 +122,13 @@ ## 2.15.0 (2021-03-14)

* Device's current state will be requested immediately when initialised into Homebridge
* Optional polling setting for newer **Wemo Dimmers** that don't automatically notify the plugin when the brightness is changed externally
* Optional 'timeout' setting for **Wemo Insight** to configure a minimum time between wattage log entries
- Device's current state will be requested immediately when initialised into Homebridge
- Optional polling setting for newer **Wemo Dimmers** that don't automatically notify the plugin when the brightness is changed externally
- Optional 'timeout' setting for **Wemo Insight** to configure a minimum time between wattage log entries
### Changes
* Open/close time setting for **Wemo Makers** will be hidden if device is set to expose as switch
* **Wemo Makers** no longer need 'dummy' contact sensor to view Eve history
* For this reason, the `exposeContactSensor` setting is now redundant and so has been removed
* Adaptive Lighting now requires Homebridge 1.3 release
* **Wemo Crockpot** polling interval will be stopped if Homebridge shuts down
- Open/close time setting for **Wemo Makers** will be hidden if device is set to expose as switch
- **Wemo Makers** no longer need 'dummy' contact sensor to view Eve history
- For this reason, the `exposeContactSensor` setting is now redundant and so has been removed
- Adaptive Lighting now requires Homebridge 1.3 release
- **Wemo Crockpot** polling interval will be stopped if Homebridge shuts down

@@ -131,12 +139,12 @@ ## 2.14.0 (2021-03-02)

* A `label` setting per device group which has no effect except to help identify the device when editing the configuration
* [experimental] Expose a Contact Sensor service for your Wemo Maker (via the plugin settings, when configured as a Garage Door) to show more information in the Eve app, including:
* when the door was last open
* how many times it's been opened
* for how long the garage door was open each time
- A `label` setting per device group which has no effect except to help identify the device when editing the configuration
- [experimental] Expose a Contact Sensor service for your Wemo Maker (via the plugin settings, when configured as a Garage Door) to show more information in the Eve app, including:
- when the door was last open
- how many times it's been opened
- for how long the garage door was open each time
### Changes
* Plugin will now check if a device is ignored by the device USN at an earlier stage of being discovered
* Updated minimum Node to v14.16.0
- Plugin will now check if a device is ignored by the device USN at an earlier stage of being discovered
- Updated minimum Node to v14.16.0

@@ -147,14 +155,14 @@ ## 2.13.0 (2021-02-17)

* **Configuration**
* Explicitly enable device logging *per* device if you have `disableDeviceLogging` set to `true`
* `brightnessStep` option to specify a brightness step in the Home app per Wemo Dimmer/Bulb
* `adaptiveLightingShift` option to offset the Adaptive Lighting values per Wemo Bulb
* Plugin-UI shows an status icon next to the reachability + shows device firmware
* In debug mode, the plugin will log each device's customised options when initialised
- **Configuration**
- Explicitly enable device logging _per_ device if you have `disableDeviceLogging` set to `true`
- `brightnessStep` option to specify a brightness step in the Home app per Wemo Dimmer/Bulb
- `adaptiveLightingShift` option to offset the Adaptive Lighting values per Wemo Bulb
- Plugin-UI shows an status icon next to the reachability + shows device firmware
- In debug mode, the plugin will log each device's customised options when initialised
### Changes
* Raised minimum Homebridge beta required for Adaptive Lighting to 1.3.0-beta.58
* Disable Adaptive Lighting if the plugin detects a significant colour change (i.e. controlled externally)
* Fixes a uuid error when adding Insights to Homebridge
- Raised minimum Homebridge beta required for Adaptive Lighting to 1.3.0-beta.58
- Disable Adaptive Lighting if the plugin detects a significant colour change (i.e. controlled externally)
- Fixes a uuid error when adding Insights to Homebridge

@@ -165,17 +173,17 @@ ## 2.12.0 (2021-02-13)

* A queue for device loading to improve reliability for users with a lot of Wemo devices
* Configuration checks to highlight any unnecessary or incorrectly formatted settings you have
* Network Settings section to the Homebridge UI where you can configure the settings that were the `wemoClient` settings
* Links to 'Configuration' and 'Uninstall' wiki pages in the plugin-ui
- A queue for device loading to improve reliability for users with a lot of Wemo devices
- Configuration checks to highlight any unnecessary or incorrectly formatted settings you have
- Network Settings section to the Homebridge UI where you can configure the settings that were the `wemoClient` settings
- Links to 'Configuration' and 'Uninstall' wiki pages in the plugin-ui
### Changes
* ⚠️ `disableDiscovery`, `noMotionTimer`, `doorOpenTimer` and `outletAsSwitch` settings no longer have any effect
* Adapted port scanning method which now checks the reachability of the `setup.xml` file
* Hide unused modes for `HeaterCooler` services for Wemo Heater, Dehumidifier, Purifier and Crockpot
* Error messages refactored to show the most useful information
* Updated minimum Homebridge to v1.1.7
* Updated minimum Node to v14.15.5
* Fakegato library formatting and simplification
* [Backend] Code refactoring
- ⚠️ `disableDiscovery`, `noMotionTimer`, `doorOpenTimer` and `outletAsSwitch` settings no longer have any effect
- Adapted port scanning method which now checks the reachability of the `setup.xml` file
- Hide unused modes for `HeaterCooler` services for Wemo Heater, Dehumidifier, Purifier and Crockpot
- Error messages refactored to show the most useful information
- Updated minimum Homebridge to v1.1.7
- Updated minimum Node to v14.15.5
- Fakegato library formatting and simplification
- [Backend] Code refactoring

@@ -186,15 +194,15 @@ ## 2.11.0 (2021-02-01)

* **Configuration Changes**
* These changes are backwards compatible with existing setups
* New 'Wemo Outlets' section to define outlets to show as switches
* Removal of `removeByName` from the UI, this setting is still available manually
* Deprecation of the following settings:
* `disableDiscovery` - now has no effect
* `doorOpenTimer` - now configured per Wemo Maker device in the 'Wemo Makers' section
* `noMotionTimer` - now configured per Wemo Motion device in the 'Wemo Motions' section
* `outletAsSwitch` - now configured per Wemo Outlet device in the 'Wemo Outlets' section
* These deprecated settings have their own section in the plugin UI
* Properly catch exceptions on SSDP search errors
* Clean up the plugin-ui by removing unnecessary descriptions
* Fixes a bug when initialising Garage Doors
- **Configuration Changes**
- These changes are backwards compatible with existing setups
- New 'Wemo Outlets' section to define outlets to show as switches
- Removal of `removeByName` from the UI, this setting is still available manually
- Deprecation of the following settings:
- `disableDiscovery` - now has no effect
- `doorOpenTimer` - now configured per Wemo Maker device in the 'Wemo Makers' section
- `noMotionTimer` - now configured per Wemo Motion device in the 'Wemo Motions' section
- `outletAsSwitch` - now configured per Wemo Outlet device in the 'Wemo Outlets' section
- These deprecated settings have their own section in the plugin UI
- Properly catch exceptions on SSDP search errors
- Clean up the plugin-ui by removing unnecessary descriptions
- Fixes a bug when initialising Garage Doors

@@ -205,29 +213,29 @@ ## 2.10.0 (2021-01-30)

* New configuration option `mode` to choose between:
* `mode: "auto"` the plugin will auto-discover devices **and** configure manual devices (default if option not set)
* `mode: "manual"` the plugin will **only** configure manual devices
* `discoveryInterval` now needs a minimum value of `15` and discovery cannot be disabled
* Existing configurations with lower value will be disregarded and `15` will be used
* The option of disabling the discovery interval has been removed as this interval is essential for correcting connection issues for all your Wemo devices
- New configuration option `mode` to choose between:
- `mode: "auto"` the plugin will auto-discover devices **and** configure manual devices (default if option not set)
- `mode: "manual"` the plugin will **only** configure manual devices
- `discoveryInterval` now needs a minimum value of `15` and discovery cannot be disabled
- Existing configurations with lower value will be disregarded and `15` will be used
- The option of disabling the discovery interval has been removed as this interval is essential for correcting connection issues for all your Wemo devices
### New
* Support for the Wemo Outdoor Plug
* [Experimental] Automatic port scan for manual devices
* Use a full address `http://192.168.1.X:49153/setup.xml` as before to fully configure a manual device
* Use an IP `192.168.1.X` to let the plugin scan between ports 49152 - 49155 and choose the correct port
* Set a custom `noMotionTimer` per Wemo motion device (NetCam/Motion Sensor)
* If this is not configured then the plugin will continue to use the global `noMotionTimer` setting per motion device
* If the global setting is not configured then the plugin will use the default of 60 seconds
* Cumulative `TotalConsumption` for Insight devices
* This changes the current method of resetting each day
* This can be reverted back to resetting each day in the plugin settings with the `showTodayTC` config option
* Set a custom `wattDiff` (wattage difference) for Insight devices - the plugin will not log consecutive wattage updates if the difference from the previous is less than this value (default: `0`)
- Support for the Wemo Outdoor Plug
- [Experimental] Automatic port scan for manual devices
- Use a full address `http://192.168.1.X:49153/setup.xml` as before to fully configure a manual device
- Use an IP `192.168.1.X` to let the plugin scan between ports 49152 - 49155 and choose the correct port
- Set a custom `noMotionTimer` per Wemo motion device (NetCam/Motion Sensor)
- If this is not configured then the plugin will continue to use the global `noMotionTimer` setting per motion device
- If the global setting is not configured then the plugin will use the default of 60 seconds
- Cumulative `TotalConsumption` for Insight devices
- This changes the current method of resetting each day
- This can be reverted back to resetting each day in the plugin settings with the `showTodayTC` config option
- Set a custom `wattDiff` (wattage difference) for Insight devices - the plugin will not log consecutive wattage updates if the difference from the previous is less than this value (default: `0`)
### Changes
* Logging for manual devices that cause errors when loading (e.g. IP/port change)
* Fixes an issue where the Insight would consistently log outlet-in-use between true and false
* More consistent and clearer error logging
* Updated plugin-ui-utils dep and use new method to get cached accessories
- Logging for manual devices that cause errors when loading (e.g. IP/port change)
- Fixes an issue where the Insight would consistently log outlet-in-use between true and false
- More consistent and clearer error logging
- Updated plugin-ui-utils dep and use new method to get cached accessories

@@ -238,6 +246,6 @@ ## 2.9.1 (2021-01-21)

* Minimum Homebridge beta needed for Adaptive Lighting bumped to beta-46
* Fixes a 'multiple callback' issue with Fakegato history service
* Fakegato logging disabled in Homebridge `debug` mode, can be explicitly enabled with `debugFakegato`
* Unsupported device types to show urn in logs
- Minimum Homebridge beta needed for Adaptive Lighting bumped to beta-46
- Fixes a 'multiple callback' issue with Fakegato history service
- Fakegato logging disabled in Homebridge `debug` mode, can be explicitly enabled with `debugFakegato`
- Unsupported device types to show urn in logs

@@ -247,12 +255,14 @@ ## 2.9.0 (2021-01-14)

### New
* New configuration option `removeByName` to remove 'orphan' accessories from the cache
* (Backend) Gracefully close listener server and ssdp client on Homebridge shutdown
* Created CHANGELOG.md
- New configuration option `removeByName` to remove 'orphan' accessories from the cache
- (Backend) Gracefully close listener server and ssdp client on Homebridge shutdown
- Created CHANGELOG.md
### Changes
* Modifications to the layout of the plugin settings screen
* Removal of maximum value for `number` types on plugin settings screen
* Remove `renewing subscription` log entries which appeared repetitively in plugin `debug` mode
* `subscription error` log entries will now always appear, not just when in plugin `debug` mode
* Changes to startup log messages
* Backend code changes
- Modifications to the layout of the plugin settings screen
- Removal of maximum value for `number` types on plugin settings screen
- Remove `renewing subscription` log entries which appeared repetitively in plugin `debug` mode
- `subscription error` log entries will now always appear, not just when in plugin `debug` mode
- Changes to startup log messages
- Backend code changes

@@ -21,13 +21,10 @@ {

"default": "auto",
"oneOf": [{
"oneOf": [
{
"title": "Auto (Discovery + Manual Devices)",
"enum": [
"auto"
]
"enum": ["auto"]
},
{
"title": "Manual (Only Manual Devices)",
"enum": [
"manual"
]
"enum": ["manual"]
}

@@ -82,13 +79,10 @@ ]

"title": "Show As",
"oneOf": [{
"oneOf": [
{
"title": "A Garage Door",
"enum": [
"garageDoor"
]
"enum": ["garageDoor"]
},
{
"title": "A Switch (with contact sensor if exists)",
"enum": [
"switch"
]
"enum": ["switch"]
}

@@ -362,13 +356,8 @@ ]

},
"layout": [{
"layout": [
{
"type": "fieldset",
"title": "Optional Settings",
"expandable": true,
"items": [
"mode",
"discoveryInterval",
"disableDeviceLogging",
"debug",
"disablePlugin"
]
"items": ["mode", "discoveryInterval", "disableDeviceLogging", "debug", "disablePlugin"]
},

@@ -382,12 +371,14 @@ {

"type": "array",
"items": [{
"type": "fieldset",
"items": [
"makerTypes[].serialNumber",
"makerTypes[].label",
"makerTypes[].makerType",
"makerTypes[].makerTimer",
"makerTypes[].overrideDisabledLogging"
]
}]
"items": [
{
"type": "fieldset",
"items": [
"makerTypes[].serialNumber",
"makerTypes[].label",
"makerTypes[].makerType",
"makerTypes[].makerTimer",
"makerTypes[].overrideDisabledLogging"
]
}
]
},

@@ -401,13 +392,15 @@ {

"type": "array",
"items": [{
"type": "fieldset",
"items": [
"wemoInsights[].serialNumber",
"wemoInsights[].label",
"wemoInsights[].showTodayTC",
"wemoInsights[].wattDiff",
"wemoInsights[].timeDiff",
"wemoInsights[].overrideDisabledLogging"
]
}]
"items": [
{
"type": "fieldset",
"items": [
"wemoInsights[].serialNumber",
"wemoInsights[].label",
"wemoInsights[].showTodayTC",
"wemoInsights[].wattDiff",
"wemoInsights[].timeDiff",
"wemoInsights[].overrideDisabledLogging"
]
}
]
},

@@ -421,13 +414,15 @@ {

"type": "array",
"items": [{
"type": "fieldset",
"items": [
"wemoLights[].serialNumber",
"wemoLights[].label",
"wemoLights[].brightnessStep",
"wemoLights[].adaptiveLightingShift",
"wemoLights[].pollingInterval",
"wemoLights[].overrideDisabledLogging"
]
}]
"items": [
{
"type": "fieldset",
"items": [
"wemoLights[].serialNumber",
"wemoLights[].label",
"wemoLights[].brightnessStep",
"wemoLights[].adaptiveLightingShift",
"wemoLights[].pollingInterval",
"wemoLights[].overrideDisabledLogging"
]
}
]
},

@@ -441,11 +436,13 @@ {

"type": "array",
"items": [{
"type": "fieldset",
"items": [
"wemoMotions[].serialNumber",
"wemoMotions[].label",
"wemoMotions[].noMotionTimer",
"wemoMotions[].overrideDisabledLogging"
]
}]
"items": [
{
"type": "fieldset",
"items": [
"wemoMotions[].serialNumber",
"wemoMotions[].label",
"wemoMotions[].noMotionTimer",
"wemoMotions[].overrideDisabledLogging"
]
}
]
},

@@ -459,11 +456,13 @@ {

"type": "array",
"items": [{
"type": "fieldset",
"items": [
"wemoOutlets[].serialNumber",
"wemoOutlets[].label",
"wemoOutlets[].showAsSwitch",
"wemoOutlets[].overrideDisabledLogging"
]
}]
"items": [
{
"type": "fieldset",
"items": [
"wemoOutlets[].serialNumber",
"wemoOutlets[].label",
"wemoOutlets[].showAsSwitch",
"wemoOutlets[].overrideDisabledLogging"
]
}
]
},

@@ -477,10 +476,12 @@ {

"type": "array",
"items": [{
"type": "fieldset",
"items": [
"wemoOthers[].serialNumber",
"wemoOthers[].label",
"wemoOthers[].overrideDisabledLogging"
]
}]
"items": [
{
"type": "fieldset",
"items": [
"wemoOthers[].serialNumber",
"wemoOthers[].label",
"wemoOthers[].overrideDisabledLogging"
]
}
]
},

@@ -493,8 +494,8 @@ {

"type": "array",
"items": [{
"type": "fieldset",
"items": [
"manualDevices[]"
]
}]
"items": [
{
"type": "fieldset",
"items": ["manualDevices[]"]
}
]
},

@@ -507,8 +508,8 @@ {

"type": "array",
"items": [{
"type": "fieldset",
"items": [
"ignoredDevices[]"
]
}]
"items": [
{
"type": "fieldset",
"items": ["ignoredDevices[]"]
}
]
},

@@ -527,2 +528,2 @@ {

]
}
}

@@ -137,7 +137,9 @@ /* jshint -W014, -W033, esversion: 9 */

// Generate the XML to send to the device
const xml = xmlbuilder.create('s:Envelope', {
version: '1.0',
encoding: 'utf-8',
allowEmpty: true
}).att('xmlns:s', 'http://schemas.xmlsoap.org/soap/envelope/')
const xml = xmlbuilder
.create('s:Envelope', {
version: '1.0',
encoding: 'utf-8',
allowEmpty: true
})
.att('xmlns:s', 'http://schemas.xmlsoap.org/soap/envelope/')
.att('s:encodingStyle', 'http://schemas.xmlsoap.org/soap/encoding/')

@@ -144,0 +146,0 @@ .ele('s:Body')

@@ -19,5 +19,6 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoOthers[device.serialNumber]
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -30,3 +31,4 @@ // Set up variables from the accessory

// Add the heater service if it doesn't already exist
this.service = this.accessory.getService(this.hapServ.HeaterCooler) ||
this.service =
this.accessory.getService(this.hapServ.HeaterCooler) ||
this.accessory.addService(this.hapServ.HeaterCooler)

@@ -47,3 +49,4 @@

// Add the set handler and a range to the heater target temperature characteristic
this.service.getCharacteristic(this.hapChar.HeatingThresholdTemperature)
this.service
.getCharacteristic(this.hapChar.HeatingThresholdTemperature)
.setProps({

@@ -59,3 +62,4 @@ minValue: 0,

// Add the set handler to the heater rotation speed characteristic
this.service.getCharacteristic(this.hapChar.RotationSpeed)
this.service
.getCharacteristic(this.hapChar.RotationSpeed)
.setProps({ minStep: 33 })

@@ -132,10 +136,6 @@ .onSet(async value => {

}
await this.client.sendRequest(
'urn:Belkin:service:basicevent:1',
'SetCrockpotState',
{
mode: { '#text': mode },
time: { '#text': time }
}
)
await this.client.sendRequest('urn:Belkin:service:basicevent:1', 'SetCrockpotState', {
mode: { '#text': mode },
time: { '#text': time }
})
}

@@ -174,3 +174,5 @@

try {
const updateKeyMode = Math.random().toString(36).substr(2, 8)
const updateKeyMode = Math.random()
.toString(36)
.substr(2, 8)
this.updateKeyMode = updateKeyMode

@@ -227,3 +229,5 @@ await this.funcs.sleep(500)

try {
const updateKeyTemp = Math.random().toString(36).substr(2, 8)
const updateKeyTemp = Math.random()
.toString(36)
.substr(2, 8)
this.updateKeyTemp = updateKeyTemp

@@ -230,0 +234,0 @@ await this.funcs.sleep(500)

@@ -24,15 +24,16 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoLights[device.serialNumber]
this.brightStep = deviceConf && deviceConf.brightnessStep
? Math.min(deviceConf.brightnessStep, 100)
: platform.consts.defaultValues.brightnessStep
this.pollingInterval = deviceConf && deviceConf.pollingInterval
? deviceConf.pollingInterval
: false
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.brightStep =
deviceConf && deviceConf.brightnessStep
? Math.min(deviceConf.brightnessStep, 100)
: platform.consts.defaultValues.brightnessStep
this.pollingInterval =
deviceConf && deviceConf.pollingInterval ? deviceConf.pollingInterval : false
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
// Add the lightbulb service if it doesn't already exist
this.service = accessory.getService(this.hapServ.Lightbulb) ||
accessory.addService(this.hapServ.Lightbulb)
this.service =
accessory.getService(this.hapServ.Lightbulb) || accessory.addService(this.hapServ.Lightbulb)

@@ -45,3 +46,4 @@ // Add the set handler to the lightbulb on/off characteristic

// Add the set handler to the lightbulb brightness characteristic
this.service.getCharacteristic(this.hapChar.Brightness)
this.service
.getCharacteristic(this.hapChar.Brightness)
.setProps({ minStep: this.brightStep })

@@ -114,7 +116,3 @@ .onSet(async value => {

}
await this.client.sendRequest(
'urn:Belkin:service:basicevent:1',
'SetBinaryState',
value
)
await this.client.sendRequest('urn:Belkin:service:basicevent:1', 'SetBinaryState', value)
}

@@ -147,6 +145,3 @@

async getCurrentBrightness () {
const data = await this.client.sendRequest(
'urn:Belkin:service:basicevent:1',
'GetBinaryState'
)
const data = await this.client.sendRequest('urn:Belkin:service:basicevent:1', 'GetBinaryState')
return parseInt(data.brightness)

@@ -191,3 +186,5 @@ }

try {
const updateKey = Math.random().toString(36).substr(2, 8)
const updateKey = Math.random()
.toString(36)
.substr(2, 8)
this.updateKey = updateKey

@@ -194,0 +191,0 @@ await this.funcs.sleep(300)

@@ -21,5 +21,6 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoOthers[device.serialNumber]
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -32,3 +33,4 @@ // Set up variables from the accessory

// Add the heater service if it doesn't already exist
this.service = this.accessory.getService(this.hapServ.HeaterCooler) ||
this.service =
this.accessory.getService(this.hapServ.HeaterCooler) ||
this.accessory.addService(this.hapServ.HeaterCooler)

@@ -49,3 +51,4 @@

// Add the set handler and a range to the heater target temperature characteristic
this.service.getCharacteristic(this.hapChar.HeatingThresholdTemperature)
this.service
.getCharacteristic(this.hapChar.HeatingThresholdTemperature)
.setProps({

@@ -61,3 +64,4 @@ minStep: 1,

// Add the set handler to the heater rotation speed characteristic
this.service.getCharacteristic(this.hapChar.RotationSpeed)
this.service
.getCharacteristic(this.hapChar.RotationSpeed)
.setProps({ minStep: 33 })

@@ -172,11 +176,13 @@ .onSet(async value => {

})
const xmlAttributes = Object.keys(attributes).map(attributeKey => builder.buildObject({
name: attributeKey,
value: attributes[attributeKey]
})).join('')
await this.client.sendRequest(
'urn:Belkin:service:deviceevent:1',
'SetAttributes',
{ attributeList: { '#text': xmlAttributes } }
)
const xmlAttributes = Object.keys(attributes)
.map(attributeKey =>
builder.buildObject({
name: attributeKey,
value: attributes[attributeKey]
})
)
.join('')
await this.client.sendRequest('urn:Belkin:service:deviceevent:1', 'SetAttributes', {
attributeList: { '#text': xmlAttributes }
})
}

@@ -219,3 +225,5 @@

try {
const updateKeyMode = Math.random().toString(36).substr(2, 8)
const updateKeyMode = Math.random()
.toString(36)
.substr(2, 8)
this.updateKeyMode = updateKeyMode

@@ -266,3 +274,5 @@ await this.funcs.sleep(500)

try {
const updateKeyTemp = Math.random().toString(36).substr(2, 8)
const updateKeyTemp = Math.random()
.toString(36)
.substr(2, 8)
this.updateKeyTemp = updateKeyTemp

@@ -332,3 +342,3 @@ await this.funcs.sleep(500)

if (value > 50) {
value = Math.round((value - 32) * 5 / 9)
value = Math.round(((value - 32) * 5) / 9)
}

@@ -354,3 +364,3 @@ value = Math.max(Math.min(value, 29), 16)

if (value > 50) {
value = Math.round((value - 32) * 5 / 9)
value = Math.round(((value - 32) * 5) / 9)
}

@@ -357,0 +367,0 @@ const temp = this.service.getCharacteristic(this.hapChar.CurrentTemperature).value

@@ -21,5 +21,6 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoOthers[device.serialNumber]
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -32,3 +33,4 @@ // Set up variables from the accessory

// Add the humidifier service if it doesn't already exist
this.service = this.accessory.getService(this.hapServ.HumidifierDehumidifier) ||
this.service =
this.accessory.getService(this.hapServ.HumidifierDehumidifier) ||
this.accessory.addService(this.hapServ.HumidifierDehumidifier)

@@ -42,11 +44,11 @@

// Add options to the heater target state characteristic
this.service.getCharacteristic(this.hapChar.TargetHumidifierDehumidifierState)
.setProps({
minValue: 1,
maxValue: 1,
validValues: [1]
})
this.service.getCharacteristic(this.hapChar.TargetHumidifierDehumidifierState).setProps({
minValue: 1,
maxValue: 1,
validValues: [1]
})
// Add the set handler to the heater target humidity characteristic
this.service.getCharacteristic(this.hapChar.RelativeHumidityHumidifierThreshold)
this.service
.getCharacteristic(this.hapChar.RelativeHumidityHumidifierThreshold)
.onSet(async value => {

@@ -57,3 +59,4 @@ await this.internalTargetHumidityUpdate(value)

// Add the set handler to the humidifier target state characteristic
this.service.getCharacteristic(this.hapChar.RotationSpeed)
this.service
.getCharacteristic(this.hapChar.RotationSpeed)
.setProps({ minStep: 20 })

@@ -109,9 +112,3 @@ .onSet(async value => {

if (this.debug) {
this.log(
'[%s] %s [%s: %s].',
this.name,
this.lang.recUpd,
attribute.name,
attribute.value
)
this.log('[%s] %s [%s: %s].', this.name, this.lang.recUpd, attribute.name, attribute.value)
}

@@ -169,11 +166,13 @@ switch (attribute.name) {

})
const xmlAttributes = Object.keys(attributes).map(attributeKey => builder.buildObject({
name: attributeKey,
value: attributes[attributeKey]
})).join('')
await this.client.sendRequest(
'urn:Belkin:service:deviceevent:1',
'SetAttributes',
{ attributeList: { '#text': xmlAttributes } }
)
const xmlAttributes = Object.keys(attributes)
.map(attributeKey =>
builder.buildObject({
name: attributeKey,
value: attributes[attributeKey]
})
)
.join('')
await this.client.sendRequest('urn:Belkin:service:deviceevent:1', 'SetAttributes', {
attributeList: { '#text': xmlAttributes }
})
}

@@ -209,3 +208,5 @@

try {
const updateKeyHumi = Math.random().toString(36).substr(2, 8)
const updateKeyHumi = Math.random()
.toString(36)
.substr(2, 8)
this.updateKeyHumi = updateKeyHumi

@@ -254,3 +255,5 @@ await this.funcs.sleep(500)

try {
const updateKeyMode = Math.random().toString(36).substr(2, 8)
const updateKeyMode = Math.random()
.toString(36)
.substr(2, 8)
this.updateKeyMode = updateKeyMode

@@ -315,4 +318,3 @@ await this.funcs.sleep(500)

try {
const tempState = this.service
.getCharacteristic(this.hapChar.CurrentRelativeHumidity).value
const tempState = this.service.getCharacteristic(this.hapChar.CurrentRelativeHumidity).value
if (tempState !== value) {

@@ -333,9 +335,7 @@ this.service.updateCharacteristic(this.hapChar.CurrentRelativeHumidity, value)

value = this.wemoFormatToH[value]
const tempState = this.service
.getCharacteristic(this.hapChar.RelativeHumidityHumidifierThreshold).value
const tempState = this.service.getCharacteristic(
this.hapChar.RelativeHumidityHumidifierThreshold
).value
if (tempState !== value) {
this.service.updateCharacteristic(
this.hapChar.RelativeHumidityHumidifierThreshold,
value
)
this.service.updateCharacteristic(this.hapChar.RelativeHumidityHumidifierThreshold, value)
if (!this.disableDeviceLogging) {

@@ -342,0 +342,0 @@ this.log('[%s] target humidity [%s%].', this.name, value)

@@ -26,8 +26,10 @@ /* jshint -W014, -W033, esversion: 9 */

this.showTodayTC = deviceConf && deviceConf.showTodayTC
this.wattDiff = deviceConf && deviceConf.wattDiff
? deviceConf.wattDiff
: platform.consts.defaultValues.wattDiff
this.timeDiff = deviceConf && deviceConf.timeDiff
? deviceConf.timeDiff
: platform.consts.defaultValues.timeDiff
this.wattDiff =
deviceConf && deviceConf.wattDiff
? deviceConf.wattDiff
: platform.consts.defaultValues.wattDiff
this.timeDiff =
deviceConf && deviceConf.timeDiff
? deviceConf.timeDiff
: platform.consts.defaultValues.timeDiff
if (this.timeDiff === 1) {

@@ -37,5 +39,6 @@ this.timeDiff = false

this.skipTimeDiff = false
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -130,7 +133,3 @@ if (!this.funcs.hasProperty(this.accessory.context, 'cacheLastWM')) {

// Send the update
await this.client.sendRequest(
'urn:Belkin:service:basicevent:1',
'SetBinaryState',
value
)
await this.client.sendRequest('urn:Belkin:service:basicevent:1', 'SetBinaryState', value)
}

@@ -340,5 +339,3 @@

this.eveChar.TotalConsumption,
this.showTodayTC
? todaykWh
: this.accessory.context.cacheTotalTC
this.showTodayTC ? todaykWh : this.accessory.context.cacheTotalTC
)

@@ -345,0 +342,0 @@

@@ -30,11 +30,14 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoLights[this.deviceID]
this.brightStep = deviceConf && deviceConf.brightnessStep
? Math.min(deviceConf.brightnessStep, 100)
: platform.consts.defaultValues.brightnessStep
this.alShift = deviceConf && deviceConf.adaptiveLightingShift
? deviceConf.adaptiveLightingShift
: platform.consts.defaultValues.adaptiveLightingShift
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.brightStep =
deviceConf && deviceConf.brightnessStep
? Math.min(deviceConf.brightnessStep, 100)
: platform.consts.defaultValues.brightnessStep
this.alShift =
deviceConf && deviceConf.adaptiveLightingShift
? deviceConf.adaptiveLightingShift
: platform.consts.defaultValues.adaptiveLightingShift
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -93,3 +96,4 @@ // Objects containing mapping info for the device capabilities

if (this.hasBrightSupport) {
this.service.getCharacteristic(this.hapChar.Brightness)
this.service
.getCharacteristic(this.hapChar.Brightness)
.setProps({ minStep: this.brightStep })

@@ -170,18 +174,17 @@ .onSet(async value => {

}
const deviceStatusList = xmlbuilder.create('DeviceStatus', {
version: '1.0',
encoding: 'utf-8'
}).ele({
IsGroupAction: (this.deviceID.length === 10) ? 'YES' : 'NO',
DeviceID: this.deviceID,
CapabilityID: capability,
CapabilityValue: value
}).end()
await this.client.sendRequest(
'urn:Belkin:service:bridge:1',
'SetDeviceStatus',
{
DeviceStatusList: { '#text': deviceStatusList }
}
)
const deviceStatusList = xmlbuilder
.create('DeviceStatus', {
version: '1.0',
encoding: 'utf-8'
})
.ele({
IsGroupAction: this.deviceID.length === 10 ? 'YES' : 'NO',
DeviceID: this.deviceID,
CapabilityID: capability,
CapabilityValue: value
})
.end()
await this.client.sendRequest('urn:Belkin:service:bridge:1', 'SetDeviceStatus', {
DeviceStatusList: { '#text': deviceStatusList }
})
}

@@ -191,9 +194,5 @@

try {
const data = await this.client.sendRequest(
'urn:Belkin:service:bridge:1',
'GetDeviceStatus',
{
DeviceIDs: this.deviceID
}
)
const data = await this.client.sendRequest('urn:Belkin:service:bridge:1', 'GetDeviceStatus', {
DeviceIDs: this.deviceID
})
const res = await xml2js.parseStringPromise(data.DeviceStatusList, { explicitArray: false })

@@ -255,3 +254,5 @@ const deviceStatus = res.DeviceStatusList.DeviceStatus

try {
const updateKey = Math.random().toString(36).substr(2, 8)
const updateKey = Math.random()
.toString(36)
.substr(2, 8)
this.updateKeyBR = updateKey

@@ -281,3 +282,5 @@ await this.funcs.sleep(300)

try {
const updateKey = Math.random().toString(36).substr(2, 8)
const updateKey = Math.random()
.toString(36)
.substr(2, 8)
this.updateKeyCT = updateKey

@@ -284,0 +287,0 @@ await this.funcs.sleep(400)

@@ -27,8 +27,10 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoMakers[device.serialNumber]
this.doorOpenTimer = deviceConf && deviceConf.makerTimer
? deviceConf.makerTimer
: platform.consts.defaultValues.makerTimer
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.doorOpenTimer =
deviceConf && deviceConf.makerTimer
? deviceConf.makerTimer
: platform.consts.defaultValues.makerTimer
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -128,7 +130,3 @@ // Some conversion objects

}
await this.client.sendRequest(
'urn:Belkin:service:basicevent:1',
'SetBinaryState',
value
)
await this.client.sendRequest('urn:Belkin:service:basicevent:1', 'SetBinaryState', value)
}

@@ -135,0 +133,0 @@

@@ -26,5 +26,6 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoMakers[device.serialNumber]
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -37,3 +38,4 @@ // If the accessory has a garage door service then remove it

// Add the switch service if it doesn't already exist
this.service = this.accessory.getService(this.hapServ.Switch) ||
this.service =
this.accessory.getService(this.hapServ.Switch) ||
this.accessory.addService(this.hapServ.Switch)

@@ -79,7 +81,3 @@

}
await this.client.sendRequest(
'urn:Belkin:service:basicevent:1',
'SetBinaryState',
value
)
await this.client.sendRequest('urn:Belkin:service:basicevent:1', 'SetBinaryState', value)
}

@@ -86,0 +84,0 @@

@@ -23,11 +23,14 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoMotions[device.serialNumber]
this.noMotionTimer = deviceConf && deviceConf.noMotionTimer
? deviceConf.noMotionTimer
: platform.consts.defaultValues.noMotionTimer
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.noMotionTimer =
deviceConf && deviceConf.noMotionTimer
? deviceConf.noMotionTimer
: platform.consts.defaultValues.noMotionTimer
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
// Add the motion sensor service if it doesn't already exist
this.service = this.accessory.getService(this.hapServ.MotionSensor) ||
this.service =
this.accessory.getService(this.hapServ.MotionSensor) ||
this.accessory.addService(this.hapServ.MotionSensor)

@@ -34,0 +37,0 @@

@@ -24,5 +24,6 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoOutlets[device.serialNumber]
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -35,3 +36,4 @@ // If the accessory has an switch service then remove it

// Add the outlet service if it doesn't already exist
this.service = this.accessory.getService(this.hapServ.Outlet) ||
this.service =
this.accessory.getService(this.hapServ.Outlet) ||
this.accessory.addService(this.hapServ.Outlet)

@@ -75,7 +77,3 @@

// Send the update
await this.client.sendRequest(
'urn:Belkin:service:basicevent:1',
'SetBinaryState',
value
)
await this.client.sendRequest('urn:Belkin:service:basicevent:1', 'SetBinaryState', value)
}

@@ -82,0 +80,0 @@

@@ -21,5 +21,6 @@ /* jshint -W014, -W033, esversion: 9 */

const deviceConf = platform.wemoOthers[device.serialNumber]
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -32,15 +33,14 @@ // Set up variables from the accessory

// Add the purifier service if it doesn't already exist
this.service = this.accessory.getService(this.hapServ.AirPurifier) ||
this.service =
this.accessory.getService(this.hapServ.AirPurifier) ||
this.accessory.addService(this.hapServ.AirPurifier)
// Add the air quality service if it doesn't already exist
this.airService = this.accessory.getService(this.hapServ.AirQualitySensor) ||
this.accessory.addService(
this.hapServ.AirQualitySensor,
'Air Quality',
'airquality'
)
this.airService =
this.accessory.getService(this.hapServ.AirQualitySensor) ||
this.accessory.addService(this.hapServ.AirQualitySensor, 'Air Quality', 'airquality')
// Add the (ionizer) switch service if it doesn't already exist
this.ioService = this.accessory.getService(this.hapServ.Switch) ||
this.ioService =
this.accessory.getService(this.hapServ.Switch) ||
this.accessory.addService(this.hapServ.Switch, 'Ionizer', 'ionizer')

@@ -61,3 +61,4 @@

// Add the set handler to the purifier rotation speed (for mode) characteristic
this.service.getCharacteristic(this.hapChar.RotationSpeed)
this.service
.getCharacteristic(this.hapChar.RotationSpeed)
.setProps({ minStep: 25 })

@@ -170,11 +171,13 @@ .onSet(async value => {

})
const xmlAttributes = Object.keys(attributes).map(attributeKey => builder.buildObject({
name: attributeKey,
value: attributes[attributeKey]
})).join('')
await this.client.sendRequest(
'urn:Belkin:service:deviceevent:1',
'SetAttributes',
{ attributeList: { '#text': xmlAttributes } }
)
const xmlAttributes = Object.keys(attributes)
.map(attributeKey =>
builder.buildObject({
name: attributeKey,
value: attributes[attributeKey]
})
)
.join('')
await this.client.sendRequest('urn:Belkin:service:deviceevent:1', 'SetAttributes', {
attributeList: { '#text': xmlAttributes }
})
}

@@ -224,3 +227,5 @@

try {
const updateKey = Math.random().toString(36).substr(2, 8)
const updateKey = Math.random()
.toString(36)
.substr(2, 8)
this.updateKey = updateKey

@@ -227,0 +232,0 @@ await this.funcs.sleep(500)

@@ -24,5 +24,6 @@ /* jshint -W014, -W033, esversion: 9 */

}
this.disableDeviceLogging = deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging
this.disableDeviceLogging =
deviceConf && deviceConf.overrideDisabledLogging
? false
: platform.config.disableDeviceLogging

@@ -40,3 +41,4 @@ // Set up variables from the accessory

// Add the switch service if it doesn't already exist
this.service = this.accessory.getService(this.hapServ.Switch) ||
this.service =
this.accessory.getService(this.hapServ.Switch) ||
this.accessory.addService(this.hapServ.Switch)

@@ -85,7 +87,3 @@

// Send the update
await this.client.sendRequest(
'urn:Belkin:service:basicevent:1',
'SetBinaryState',
value
)
await this.client.sendRequest('urn:Belkin:service:basicevent:1', 'SetBinaryState', value)
}

@@ -92,0 +90,0 @@

@@ -16,3 +16,3 @@ /* jshint -W014, -W033, esversion: 9 */

const hexToBase64 = val => {
return Buffer.from(('' + val).replace(/[^0-9A-F]/ig, ''), 'hex').toString('base64')
return Buffer.from(('' + val).replace(/[^0-9A-F]/gi, ''), 'hex').toString('base64')
}

@@ -28,10 +28,9 @@

const swap16 = val => {
return ((val & 0xFF) << 8) | ((val >>> 8) & 0xFF)
return ((val & 0xff) << 8) | ((val >>> 8) & 0xff)
}
const swap32 = val => {
return ((val & 0xFF) << 24) |
((val & 0xFF00) << 8) |
((val >>> 8) & 0xFF00) |
((val >>> 24) & 0xFF)
return (
((val & 0xff) << 24) | ((val & 0xff00) << 8) | ((val >>> 8) & 0xff00) | ((val >>> 24) & 0xff)
)
}

@@ -147,12 +146,14 @@

onReady: function () {
this.load(function (err, loaded) {
if (err) {
this.log('FG history: load error: %s.', err)
} else {
if (loaded) {
this.log('FG history: loaded from storage.')
this.load(
function (err, loaded) {
if (err) {
this.log('FG history: load error: %s.', err)
} else {
if (loaded) {
this.log('FG history: loaded from storage.')
}
this.loaded = true
}
this.loaded = true
}
}.bind(this))
}.bind(this)
)
}.bind(this)

@@ -333,8 +334,12 @@ })

})
this.accessoryType116 = ' 0' +
this.accessoryType116 =
' 0' +
this.signatures.length.toString() +
' ' +
this.signatures.sort((a, b) => {
return a.signature > b.signature ? 1 : -1
}).map(a => a.signature).join(' ') +
this.signatures
.sort((a, b) => {
return a.signature > b.signature ? 1 : -1
})
.map(a => a.signature)
.join(' ') +
' '

@@ -516,3 +521,3 @@ homebridge.globalFakeGatoTimer.subscribe(this, this.calculateAverage)

}
this.history[entry2address(this.lastEntry)] = (entry)
this.history[entry2address(this.lastEntry)] = entry
if (this.usedMemory < this.memorySize) {

@@ -526,3 +531,4 @@ val = Format(

numToHex(swap16(this.memorySize), 4),
numToHex(swap32(this.firstEntry), 8))
numToHex(swap32(this.firstEntry), 8)
)
} else {

@@ -536,3 +542,4 @@ val = Format(

numToHex(swap16(this.memorySize), 4),
numToHex(swap32(this.firstEntry + 1), 8))
numToHex(swap32(this.firstEntry + 1), 8)
)
}

@@ -583,3 +590,3 @@ this.service.getCharacteristic(S2R1Characteristic).setValue(hexToBase64(val))

service: this,
data: typeof (data) === 'object' ? JSON.stringify(data) : data
data: typeof data === 'object' ? JSON.stringify(data) : data
})

@@ -600,3 +607,3 @@ } else {

// this.log('[%s] read data [%s].', this.accessoryName, data)
const jsonFile = typeof (data) === 'object' ? data : JSON.parse(data)
const jsonFile = typeof data === 'object' ? data : JSON.parse(data)
this.firstEntry = jsonFile.firstEntry

@@ -635,3 +642,3 @@ this.lastEntry = jsonFile.lastEntry

this.setTime ||
(this.currentEntry === this.firstEntry + 1)
this.currentEntry === this.firstEntry + 1
) {

@@ -660,3 +667,4 @@ this.dataStream += Format(

numToHex(swap16(this.history[this.memAddress].humidity * 100), 4),
numToHex(swap16(this.history[this.memAddress].pressure * 10), 4))
numToHex(swap16(this.history[this.memAddress].pressure * 10), 4)
)
break

@@ -669,3 +677,4 @@ case 'energy':

this.accessoryType117,
numToHex(swap16(this.history[this.memAddress].power * 10), 4))
numToHex(swap16(this.history[this.memAddress].power * 10), 4)
)
break

@@ -680,3 +689,4 @@ case 'room':

numToHex(swap16(this.history[this.memAddress].humidity * 100), 4),
numToHex(swap16(this.history[this.memAddress].ppm), 4))
numToHex(swap16(this.history[this.memAddress].ppm), 4)
)
break

@@ -691,3 +701,4 @@ case 'door':

this.accessoryType117,
numToHex(this.history[this.memAddress].status, 2))
numToHex(this.history[this.memAddress].status, 2)
)
break

@@ -701,3 +712,4 @@ case 'aqua':

this.accessoryType117,
numToHex(this.history[this.memAddress].status, 2))
numToHex(this.history[this.memAddress].status, 2)
)
} else {

@@ -710,3 +722,4 @@ this.dataStream += Format(

numToHex(this.history[this.memAddress].status, 2),
numToHex(swap32(this.history[this.memAddress].waterAmount), 8))
numToHex(swap32(this.history[this.memAddress].waterAmount), 8)
)
}

@@ -722,3 +735,4 @@ break

numToHex(swap16(this.history[this.memAddress].setTemp * 100), 4),
numToHex(this.history[this.memAddress].valvePosition, 2))
numToHex(this.history[this.memAddress].valvePosition, 2)
)
break

@@ -771,10 +785,8 @@ case 'custom': {

}
const results = dataStream +
const results =
dataStream + ' ' + numToHex(bitmask, 2) + ' ' + result.map(a => a).join(' ')
this.dataStream +=
' ' +
numToHex(bitmask, 2) +
numToHex(results.replace(/[^0-9A-F]/gi, '').length / 2 + 1) +
' ' +
result.map(a => a).join(' ')
this.dataStream += ' ' +
numToHex((results.replace(/[^0-9A-F]/ig, '').length) / 2 + 1) +
' ' +
results +

@@ -781,0 +793,0 @@ ','

@@ -35,3 +35,3 @@ /* jshint -W014, -W033, esversion: 9 */

}
const onReady = typeof (params.onReady) === 'function' ? params.onReady : () => {}
const onReady = typeof params.onReady === 'function' ? params.onReady : () => {}
newWriter.storageHandler = fs

@@ -68,8 +68,12 @@ newWriter.path = params.path || path.join(os.homedir(), '.homebridge')

const writer = this.getWriter(params.service)
const callBack = typeof (params.callback) === 'function'
? params.callback
: (typeof (writer.callback) === 'function' ? writer.callback : () => {})
const callBack =
typeof params.callback === 'function'
? params.callback
: typeof writer.callback === 'function'
? writer.callback
: () => {}
this.log(
'FG storage: write file [%s].',
path.join(writer.path, writer.fileName), params.data.substr(1, 80)
path.join(writer.path, writer.fileName),
params.data.substr(1, 80)
)

@@ -92,5 +96,8 @@ writer.storageHandler.writeFile(

const writer = this.getWriter(params.service)
const callBack = typeof (params.callback) === 'function'
? params.callback
: (typeof (writer.callback) === 'function' ? writer.callback : () => {})
const callBack =
typeof params.callback === 'function'
? params.callback
: typeof writer.callback === 'function'
? writer.callback
: () => {}
this.log('FG storage: read file [%s].', path.join(writer.path, writer.fileName))

@@ -102,5 +109,8 @@ writer.storageHandler.readFile(path.join(writer.path, writer.fileName), 'utf8', callBack)

const writer = this.getWriter(params.service)
const callBack = typeof (params.callback) === 'function'
? params.callback
: (typeof (writer.callback) === 'function' ? writer.callback : () => {})
const callBack =
typeof params.callback === 'function'
? params.callback
: typeof writer.callback === 'function'
? writer.callback
: () => {}
this.log('FG storage: delete file [%s].', path.join(writer.path, writer.fileName))

@@ -107,0 +117,0 @@ writer.storageHandler.unlink(path.join(writer.path, writer.fileName), callBack)

@@ -74,3 +74,3 @@ /* jshint -W014, -W033, esversion: 9 */

const service = this.subscribedServices[s]
if (typeof (service.callback) === 'function') {
if (typeof service.callback === 'function') {
service.previousAvrg = service.callback({

@@ -90,3 +90,3 @@ backLog: service.backLog,

this.log('FG timer: executeImmediateCallback().')
if (typeof (service.callback) === 'function' && service.backLog.length) {
if (typeof service.callback === 'function' && service.backLog.length) {
service.callback({

@@ -93,0 +93,0 @@ backLog: service.backLog,

@@ -28,3 +28,3 @@ /* jshint -W014, -W033, esversion: 9 */

uuid = toLongFormUUID(uuid, base)
return (uuid.substr(0, 8))
return uuid.substr(0, 8)
}

@@ -31,0 +31,0 @@

@@ -50,2 +50,2 @@ /* jshint -W014, -W033, esversion: 9 */

(() => new PluginUiServer())()
;(() => new PluginUiServer())()

@@ -55,3 +55,3 @@ /* jshint -W014, -W033, esversion: 9 */

if (!api.versionGreaterOrEqual || !api.versionGreaterOrEqual('1.3.0')) {
throw new Error(this.lang.hbVerionFail)
throw new Error(this.lang.hbVersionFail)
}

@@ -73,9 +73,4 @@

// Catch any errors during initialisation
const hideErrLines = [
this.lang.hbVerionFail,
this.lang.notConfigured
]
const eText = hideErrLines.includes(err.message)
? err.message
: this.funcs.parseError(err)
const hideErrLines = [this.lang.hbVersionFail, this.lang.notConfigured]
const eText = hideErrLines.includes(err.message) ? err.message : this.funcs.parseError(err)
log.warn('***** %s [v%s]. *****', this.lang.disabling, plugin.version)

@@ -146,3 +141,6 @@ log.warn('***** %s. *****', eText)

this.config.ignoredDevices.push(
serialNumber.toString().toUpperCase().replace(/[\s'"]+/g, '')
serialNumber
.toString()
.toUpperCase()
.replace(/[\s'"]+/g, '')
)

@@ -231,3 +229,6 @@ })

this.config.manualDevices.push(
manualDevice.toString().toLowerCase().replace(/[\s'"]+/g, '')
manualDevice
.toString()
.toLowerCase()
.replace(/[\s'"]+/g, '')
)

@@ -475,5 +476,3 @@ })

// Catch any errors during setup
const eText = err.message === this.lang.disabled
? err.message
: this.funcs.parseError(err)
const eText = err.message === this.lang.disabled ? err.message : this.funcs.parseError(err)
this.log.warn('***** %s [v%s]. *****', this.lang.disabling, plugin.version)

@@ -567,3 +566,3 @@ this.log.warn('***** %s. *****', eText)

} catch (e2) {
// Show warnings on runs 1, 2, 5, 8, 11, ... just to limit logging to an extent
// Show warnings on runs 1, 2, 5, 8, 11, ... just to limit logging to an extent
if (this.discoveryRun === 1 || this.discoveryRun % 3 === 2) {

@@ -800,7 +799,6 @@ const eText = this.funcs.parseError(e2)

accessory.context.firmware = device.firmwareVersion
accessory.context.icon = device.iconList &&
device.iconList.icon &&
device.iconList.icon.url
? device.iconList.icon.url
: false
accessory.context.icon =
device.iconList && device.iconList.icon && device.iconList.icon.url
? device.iconList.icon.url
: false

@@ -825,8 +823,3 @@ // Log the successfully initialised device

const eText = this.funcs.parseError(e1)
this.log.warn(
'[%s] %s %s.',
subdevice.friendlyName,
this.lang.devNotInit,
eText
)
this.log.warn('[%s] %s %s.', subdevice.friendlyName, this.lang.devNotInit, eText)
}

@@ -858,6 +851,7 @@ })

// Wemo Maker
instance = this.wemoMakers[device.serialNumber] &&
instance =
this.wemoMakers[device.serialNumber] &&
this.wemoMakers[device.serialNumber].showAsGarage
? 'maker-garage'
: 'maker-switch'
? 'maker-garage'
: 'maker-switch'
break

@@ -874,6 +868,7 @@ }

// Wemo Switch
instance = this.wemoOutlets[device.serialNumber] &&
instance =
this.wemoOutlets[device.serialNumber] &&
this.wemoOutlets[device.serialNumber].showAsSwitch
? 'switch'
: 'outlet'
? 'switch'
: 'outlet'
break

@@ -936,7 +931,6 @@ }

: false
accessory.context.icon = device.iconList &&
device.iconList.icon &&
device.iconList.icon.url
? device.iconList.icon.url
: false
accessory.context.icon =
device.iconList && device.iconList.icon && device.iconList.icon.url
? device.iconList.icon.url
: false
accessory.context.controllable = true

@@ -1003,3 +997,4 @@

const accessory = new this.api.platformAccessory(device.friendlyName, newUUID)
accessory.getService(this.api.hap.Service.AccessoryInformation)
accessory
.getService(this.api.hap.Service.AccessoryInformation)
.setCharacteristic(this.api.hap.Characteristic.Manufacturer, this.lang.brand)

@@ -1006,0 +1001,0 @@ .setCharacteristic(

@@ -60,6 +60,15 @@ /* jshint -W014, -W033, esversion: 9 */

wemoInsights: [
'serialNumber', 'label', 'showTodayTC', 'wattDiff', 'timeDiff', 'overrideDisabledLogging'
'serialNumber',
'label',
'showTodayTC',
'wattDiff',
'timeDiff',
'overrideDisabledLogging'
],
wemoLights: [
'serialNumber', 'label', 'adaptiveLightingShift', 'brightnessStep', 'pollingInterval',
'serialNumber',
'label',
'adaptiveLightingShift',
'brightnessStep',
'pollingInterval',
'overrideDisabledLogging'

@@ -66,0 +75,0 @@ ],

@@ -15,3 +15,4 @@ /* jshint -W014, -W033, esversion: 9 */

decodeXML: input => {
return input.replace(/&lt;/g, '<')
return input
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')

@@ -35,4 +36,7 @@ .replace(/&quot;/g, '"')

parseSerialNumber: input => {
return input.toString().replace(/[\s'"]+/g, '').toUpperCase()
return input
.toString()
.replace(/[\s'"]+/g, '')
.toUpperCase()
}
}
{
"name": "homebridge-platform-wemo",
"alias": "BelkinWeMo",
"version": "3.0.9",
"version": "3.0.10-beta.0",
"author": "bwp91",

@@ -21,3 +21,3 @@ "description": "Homebridge plugin to control Wemo devices.",

"homebridge": "^1.3.3",
"node": "^14.16.1"
"node": "^14.17.0"
},

@@ -57,3 +57,6 @@ "repository": {

"xmlbuilder": "^15.1.1"
},
"prettier": {
"printWidth": 100
}
}

@@ -8,12 +8,12 @@ <p align="center">

Homebridge plugin to control Wemo devices
[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
[![hoobs-certified](https://badgen.net/badge/HOOBS/certified/yellow)](https://plugins.hoobs.org/plugin/homebridge-platform-wemo)
Homebridge plugin to control Wemo devices
[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
[![hoobs-certified](https://badgen.net/badge/HOOBS/certified/yellow)](https://plugins.hoobs.org/plugin/homebridge-platform-wemo)
[![npm](https://img.shields.io/npm/v/homebridge-platform-wemo/latest?label=latest)](https://www.npmjs.com/package/homebridge-platform-wemo)
[![npm](https://img.shields.io/npm/v/homebridge-platform-wemo/beta?label=beta)](https://github.com/bwp91/homebridge-platform-wemo/wiki/Beta-Version)
[![npm](https://img.shields.io/npm/v/homebridge-platform-wemo/beta?label=beta)](https://github.com/bwp91/homebridge-platform-wemo/wiki/Beta-Version)
[![npm](https://img.shields.io/npm/dt/homebridge-platform-wemo)](https://www.npmjs.com/package/homebridge-platform-wemo)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Discord](https://img.shields.io/discord/784827113378676736?color=728ED5&logo=discord&label=bwp91-discord)](https://discord.com/channels/784827113378676736/784827113378676739)
[![Discord](https://img.shields.io/discord/432663330281226270?color=728ED5&logo=discord&label=hb-discord)](https://discord.com/channels/432663330281226270/742733745743855627)
[![Discord](https://img.shields.io/discord/432663330281226270?color=728ED5&logo=discord&label=hb-discord)](https://discord.com/channels/432663330281226270/742733745743855627)

@@ -23,38 +23,45 @@ </span>

### Plugin Information
* This plugin allows you to view and control your Wemo devices within HomeKit. The plugin:
* will attempt to discover and control Wemo devices via your local network (UPnP)
* does not require your Wemo credentials
* ⚠️ You must make sure your Homebridge instance has an allocated IP from the same IP network or VLAN as your Wemo devices.
- This plugin allows you to view and control your Wemo devices within HomeKit. The plugin:
- will attempt to discover and control Wemo devices via your local network (UPnP)
- does not require your Wemo credentials
- ⚠️ You must make sure your Homebridge instance has an allocated IP from the same IP network or VLAN as your Wemo devices.
### Prerequisites
* To use this plugin, you will need to already have [Homebridge](https://homebridge.io) (at least v1.3.3) or [HOOBS](https://hoobs.org) (at least v3.3.4) installed. Please refer to the links for more information and installation instructions.
* It is recommended to use the current LTS version of Node, currently v14, however Node v10 and v12 are also supported.
- To use this plugin, you will need to already have [Homebridge](https://homebridge.io) (at least v1.3.3) or [HOOBS](https://hoobs.org) (at least v3.3.4) installed. Please refer to the links for more information and installation instructions.
- It is recommended to use the current LTS version of Node, currently v14, however Node v12 is also supported.
### Setup
* [Installation](https://github.com/bwp91/homebridge-platform-wemo/wiki/Installation)
* [Configuration](https://github.com/bwp91/homebridge-platform-wemo/wiki/Configuration)
* [Beta Version](https://github.com/bwp91/homebridge-platform-wemo/wiki/Beta-Version)
* [Node Version](https://github.com/bwp91/homebridge-platform-wemo/wiki/Node-Version)
* [Uninstallation](https://github.com/bwp91/homebridge-platform-wemo/wiki/Uninstallation)
- [Installation](https://github.com/bwp91/homebridge-platform-wemo/wiki/Installation)
- [Configuration](https://github.com/bwp91/homebridge-platform-wemo/wiki/Configuration)
- [Beta Version](https://github.com/bwp91/homebridge-platform-wemo/wiki/Beta-Version)
- [Node Version](https://github.com/bwp91/homebridge-platform-wemo/wiki/Node-Version)
- [Uninstallation](https://github.com/bwp91/homebridge-platform-wemo/wiki/Uninstallation)
### Features
* [Supported Devices](https://github.com/bwp91/homebridge-platform-wemo/wiki/Supported-Devices)
- [Supported Devices](https://github.com/bwp91/homebridge-platform-wemo/wiki/Supported-Devices)
### Help/About
* [Common Errors](https://github.com/bwp91/homebridge-platform-wemo/wiki/Common-Errors)
* [Support Request](https://github.com/bwp91/homebridge-platform-wemo/issues/new/choose)
* [Changelog](https://github.com/bwp91/homebridge-platform-wemo/blob/latest/CHANGELOG.md)
* [About Me](https://github.com/sponsors/bwp91)
- [Common Errors](https://github.com/bwp91/homebridge-platform-wemo/wiki/Common-Errors)
- [Support Request](https://github.com/bwp91/homebridge-platform-wemo/issues/new/choose)
- [Changelog](https://github.com/bwp91/homebridge-platform-wemo/blob/latest/CHANGELOG.md)
- [About Me](https://github.com/sponsors/bwp91)
### Credits
* To the creator of this plugin: [@rudders](https://github.com/rudders), and to [@devbobo](https://github.com/devbobo) for his contributions.
* To the creator of [wemo-client](https://github.com/timonreinhard/wemo-client) (which is now contained within this plugin): [@timonreinhard](https://github.com/timonreinhard).
* To [Ben Hardill](http://www.hardill.me.uk/wordpress/tag/wemo/) for his research on Wemo devices.
* To all users who have helped/tested to enable functionality for new devices.
* To the creators/contributors of [Fakegato](https://github.com/simont77/fakegato-history): [@simont77](https://github.com/simont77) and [@NorthernMan54](https://github.com/NorthernMan54).
* To the creator of the awesome plugin header logo: [Keryan Belahcene](https://www.instagram.com/keryan.me).
* To the creators/contributors of [Homebridge](https://homebridge.io) who make this plugin possible.
- To the creator of this plugin: [@rudders](https://github.com/rudders), and to [@devbobo](https://github.com/devbobo) for his contributions.
- To the creator of [wemo-client](https://github.com/timonreinhard/wemo-client) (which is now contained within this plugin): [@timonreinhard](https://github.com/timonreinhard).
- To [Ben Hardill](http://www.hardill.me.uk/wordpress/tag/wemo/) for his research on Wemo devices.
- To all users who have helped/tested to enable functionality for new devices.
- To the creators/contributors of [Fakegato](https://github.com/simont77/fakegato-history): [@simont77](https://github.com/simont77) and [@NorthernMan54](https://github.com/NorthernMan54).
- To the creator of the awesome plugin header logo: [Keryan Belahcene](https://www.instagram.com/keryan.me).
- To the creators/contributors of [Homebridge](https://homebridge.io) who make this plugin possible.
### Disclaimer
* I am in no way affiliated with Belkin/Wemo and this plugin is a personal project that I maintain in my free time.
* Use this plugin entirely at your own risk - please see licence for more information.
- I am in no way affiliated with Belkin/Wemo and this plugin is a personal project that I maintain in my free time.
- Use this plugin entirely at your own risk - please see licence for more information.

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