Skip to content

Commit

Permalink
Fixes for thermostat support
Browse files Browse the repository at this point in the history
  • Loading branch information
kuestess committed Dec 19, 2022
1 parent ff9307a commit 2b72de9
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 41 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/main.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Tag and Release

on:
push:
branches:
- master

jobs:
create-tag:
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.create-tag.outputs.version }}
steps:
- name: checkout
id: checkout
uses: actions/checkout@v2
- name: create-tag
id: create-tag
uses: Klemensas/action-autotag@stable
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
tag_prefix: "v"
draft-release:
needs: create-tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get version from tag
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
shell: bash
- uses: actions/checkout@v2
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{needs.create-tag.outputs.output1}}
# version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
- uses: ncipollo/release-action@v1
with:
tag: v${{needs.create-tag.outputs.output1}}
name: Release ${{ steps.changelog_reader.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}
# prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: true
allowUpdates: true
artifacts: "*,src/*"
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

All notable changes to this project will be documented in this file.

## 0.5.6
- [FIXED] Fixes for thermostat support
## 0.5.5
- [FIXED] Fixes for group members defined by name (#260)
- [FIXED] Fixes for removing or renaming accessories
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"displayName": "InsteonLocal",
"name": "homebridge-platform-insteonlocal",
"version": "0.5.5",
"version": "0.5.6",
"description": "Insteon platform plugin with local control for homebridge: https://github.com/nfarina/homebridge",
"license": "ISC",
"repository": {
Expand Down
19 changes: 14 additions & 5 deletions src/InsteonLocalAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@ export class InsteonLocalAccessory {
});
}

setTemperature(temp){
async setTemperature(temp){
if(this.disabled){
this.log.debug('Device ' + this.name + ' is disabled');
return;
Expand All @@ -1986,6 +1986,7 @@ export class InsteonLocalAccessory {
this.platform.checkHubConnection();
this.lastUpdate = moment();

this.mode = await this.getThermostatMode();
this.log.debug(this.name + ' mode is ' + this.mode);

if(this.mode == 'heat') {
Expand Down Expand Up @@ -2061,7 +2062,15 @@ export class InsteonLocalAccessory {
this.log.debug('Set ' + this.name + ' mode to ' + mode);
});
}
}
function getTemperature() {
throw new Error('Function not implemented.');
}

getThermostatMode() {
return this.thermostat.mode((err, mode)=>{
if(err || !mode || typeof(mode) === 'undefined'){
return new Error('Thermostat did not return current mode');
}

this.log.debug('Thermostat ' + this.name + ' mode is ' + mode);
return mode;
});
}
}

0 comments on commit 2b72de9

Please sign in to comment.