Skip to content

Commit

Permalink
Support for fahrenheit temperature sources #495
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwi-cam committed Jun 9, 2022
1 parent 2b933b1 commit 172bef1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Added support for fahrenheit temperature sources #495 - set tempSourceUnits to 'F'

## [4.4.11] - 2022-06-08
### Added
- MQTT support for zigbee2mqtt (Thanks @mikicof) #467
### Fixed
Expand Down
3 changes: 2 additions & 1 deletion accessories/aircon.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,14 @@ class AirConAccessory extends BroadlinkRMAccessory {

onTemperature (temperature,humidity) {
const { config, host, logLevel, log, name, state } = this;
const { minTemperature, maxTemperature, temperatureAdjustment, humidityAdjustment, noHumidity } = config;
const { minTemperature, maxTemperature, temperatureAdjustment, humidityAdjustment, noHumidity, tempSourceUnits } = config;

// onTemperature is getting called twice. No known cause currently.
// This helps prevent the same temperature from being processed twice
if (Object.keys(this.temperatureCallbackQueue).length === 0) {return;}

temperature += temperatureAdjustment;
if (tempSourceUnits == 'F') {temperature = (temperature - 32) * 5/9;}
state.currentTemperature = temperature;
if(logLevel <=1) {log(`\x1b[34m[DEBUG]\x1b[0m ${name} onTemperature (${temperature})`);}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "homebridge-broadlink-rm-pro",
"displayName": "Homebridge Broadlink RM Pro",
"version": "4.4.11-beta.4",
"version": "4.4.12-beta.0",
"description": "Broadlink RM plugin (including the mini and pro) for homebridge with AC Pro and TV features",
"license": "ISC",
"scripts": {
Expand Down

0 comments on commit 172bef1

Please sign in to comment.