jllcunha / openhab-greeair-binding

A openHab2 binding for Gree Airconditioners
Apache License 2.0
17 stars 13 forks source link

Adding Fahrenheit Support for GreeDevice.java #3

Closed gurglespuge closed 5 years ago

gurglespuge commented 5 years ago

@jllcunha, Really appreciate your openhab binding for the gree A/C been, it has very very helpful for me.This is super generous of your time.

The merge is mods to GreeDevice.java to allow openhab to command a temperature in Fahrenheit. The modified set temperature method checks the input value and guesses which range is trying to be set and sends the appropriate command. it involves setting TemUn and TemRec.

As far as I can tell from looking at the traffic, TemRec is just a 1/0 bit that tells the A/C which Fahrenheit temperature to choose (upper or lower ) closest to the commanded C temperature.

the HashMap tempRanges is just a simple look up table to query the max and min temp ranges for the different temperature scales. I don't know if other units have different ranges. The hope was to make it a little easier to mod in the future.

It built ok on the latest 2.4.0 branch and it built it on 2.2.0 for an older setup as well.

Figured it might be useful for others, and yours is the main repo.