Skip to content

Commit

Permalink
Merge pull request dkilgore90#57 from dkilgore90/fan-status
Browse files Browse the repository at this point in the history
Fan status
  • Loading branch information
dkilgore90 authored Apr 17, 2021
2 parents f4b0268 + e7f05c6 commit a942e30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## 2021-04-13

### sdm-api-app:0.5.1
* Fix event processing logic to correctly update thermostatOperatingState for fan timer events
* Add units to temperature and humidity attributes

## 2020-12-10

### sdm-api-app:0.5.0
Expand Down
2 changes: 1 addition & 1 deletion packageManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"required": true,
"oauth": true,
"primary": true,
"version": "0.5.0"
"version": "0.5.1"
}
],
"drivers": [
Expand Down
8 changes: 4 additions & 4 deletions sdm-api-app.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import groovy.json.JsonSlurper
* from the copyright holder
* Software is provided without warranty and your use of it is at your own risk.
*
* version: 0.5.0
* version: 0.5.1
*/

definition(
Expand Down Expand Up @@ -410,12 +410,12 @@ def processThermostatTraits(device, details) {
def nestHvac = details.traits['sdm.devices.traits.ThermostatHvac']?.status
def operState = ''
fanStatus = fanStatus ? fanStatus.toLowerCase() : device.currentValue('thermostatFanMode')
if (nestHvac == 'OFF') {
operState = fanStatus == 'on' ? 'fan only' : 'idle'
if (nestHvac == 'OFF' || nestHvac == null) {
operState = fanStatus == 'ON' ? 'fan only' : 'idle'
} else {
operState = nestHvac?.toLowerCase()
}
nestHvac ? sendEvent(device, [name: 'thermostatOperatingState', value: operState]) : null
operState ? sendEvent(device, [name: 'thermostatOperatingState', value: operState]) : null
def tempScale = details.traits['sdm.devices.traits.Settings']?.temperatureScale
tempScale ? sendEvent(device, [name: 'tempScale', value: tempScale]) : null
if (tempScale && tempScale.substring(0, 1) != getTemperatureScale()) {
Expand Down

0 comments on commit a942e30

Please sign in to comment.