diff --git a/.github/workflows/npm-publish Dev.yml b/.github/workflows/npm-publish Dev.yml new file mode 100644 index 0000000..3e906df --- /dev/null +++ b/.github/workflows/npm-publish Dev.yml @@ -0,0 +1,33 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + push: + branches: + - Dev + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm install + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm install + - run: npm publish --tag dev + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/CHANGELOG.md b/CHANGELOG.md index 99a69ab..a275e6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,25 @@ # homebridge-wyze-smart-home ## Releases +### v0.5.25-dev.0 +- Support for Thermostat +- Support for Wall Switch +- Support for HMS +### v0.5.25-beta.3 +- Wall Switch Status update +- HMS +- Lock support is broken +### v0.5.25-beta.2 +- Wall Switch was not status being followed +- Unable to turn Wall Switch On or Off. +- LOCK support is broken for this release +### v0.5.25-beta.1 +- Wall Switch Support +- Lock changes - Reduce calls to wyze platform +- Major Changes to SDK +- Initial support for Thermostat in SDK +- Initial support for HMS in SDK. + ### v0.5.24 - Release diff --git a/package.json b/package.json index ee4ff09..5d6090c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-wyze-smart-home", - "version": "0.5.25-beta.4", + "version": "0.5.25-dev.0", "description": "Wyze Smart Home plugin for Homebridge", "license": "MIT", "main": "src/index.js", diff --git a/src/WyzeSmartHome.js b/src/WyzeSmartHome.js index 2890304..ddf704c 100644 --- a/src/WyzeSmartHome.js +++ b/src/WyzeSmartHome.js @@ -9,6 +9,7 @@ const WyzeMotionSensor = require('./accessories/WyzeMotionSensor') const WyzeTemperatureHumidity = require('./accessories/WyzeTemperatureHumidity') const WyzeLeakSensor = require('./accessories/WyzeLeakSensor') const WyzeCamera = require('./accessories/WyzeCamera') +const WyzeSwitch = require('./accessories/WyzeSwitch') const WyzeHMS = require('./accessories/WyzeHMS') const WyzeThermostat = require('./accessories/WyzeThermostat') @@ -52,7 +53,6 @@ module.exports = class WyzeSmartHome { async runLoop() { const interval = this.config.refreshInterval || DEFAULT_REFRESH_INTERVAL - // eslint-disable-next-line no-constant-condition while (true) { try { @@ -153,6 +153,9 @@ module.exports = class WyzeSmartHome { case 'Camera': if (model === 'WYZEDB3') return return WyzeCamera + case 'Common': + if (model === 'JA_HP') return + return WyzeSwitch case 'S1Gateway': return WyzeHMS case 'Thermostat': diff --git a/src/accessories/WyzeAccessory.js b/src/accessories/WyzeAccessory.js index e69071b..31573c4 100644 --- a/src/accessories/WyzeAccessory.js +++ b/src/accessories/WyzeAccessory.js @@ -294,25 +294,25 @@ module.exports = class WyzeAccessory { } } break - case "Thermostat": - this.homeKitAccessory.context = { - mac: device.mac, - product_type: device.product_type, - product_model: device.product_model, - nickname: device.nickname, - conn_state: device.conn_state, - push_switch: device.push_switch, - device_params: device.device_params = { - temperature: this.thermostatTemperature, - cool_sp: this.thermostatCoolSetpoint, - heat_sp: this.thermostatHeatSetpoint, - working_state: this.thermostatWorkingState, - temp_unit: this.thermostatTempUnit, - mode_sys: this.thermostatModeSys, - time2temp_val: this.thermostatTime2Temp - } - } - break + case "Thermostat": + this.homeKitAccessory.context = { + mac: device.mac, + product_type: device.product_type, + product_model: device.product_model, + nickname: device.nickname, + conn_state: device.conn_state, + push_switch: device.push_switch, + device_params: device.device_params = { + temperature: this.thermostatTemperature, + cool_sp: this.thermostatCoolSetpoint, + heat_sp: this.thermostatHeatSetpoint, + working_state: this.thermostatWorkingState, + temp_unit: this.thermostatTempUnit, + mode_sys: this.thermostatModeSys, + time2temp_val: this.thermostatTime2Temp + } + } + break case "S1Gateway": this.homeKitAccessory.context = { mac: device.mac, @@ -328,7 +328,8 @@ module.exports = class WyzeAccessory { rssi: device.device_params.rssi, hmsID: this.hmsHmsID, hmsStatus: this.hmsStatus - } + } + } break default: this.homeKitAccessory.context = {