Closed teladog01 closed 4 years ago
After skimming the code, I see that the plugin simply checks the end of the device string to determine the unit. So I tried setting the ScaleText to "F" again, and sure enough it adds correctly with that. My mistake on that.
I am using the suffix "℉", which is the Unicode character "U+2109", so that's why the plugin was throwing the error above. "U+2103" (℃) is the Celsius equivalent. Could you add these to the scale detection?
Got it - I thought that was two characters, a degree symbol followed by F or C. Now I see that in Unicode its one. Thanks. Yes, I can fix that.
Got it - I thought that was two characters, a degree symbol followed by F or C. Now I see that in Unicode its one. Thanks. Yes, I can fix that.
Yes, it's a single Unicode character. I prefer to use it instead of the two characters (degree symbol + "F") because it takes up less space and works better for my HSTouch screens. Thank you for adding this.
Upgrade to 1.0.7 and try again. Please close out the comment if it works (or let me know if it doesn't).
Still getting the error in 1.0.7. I've never done any Javascript coding, but through trial and error I was able to get it working with this code:
case statusField.endsWith("F") || statusField.endsWith(String.fromCharCode(8457)):
U+2109 is the hex code, but fromCharCode() takes the decimal code, which is 8457. The celsius code in decimal is 8451.
Now published as version 1.0.8. Please give it a try and confirm that it works. If it does, please go ahead and close this issue. Thanks. Jim
Looks good, thanks very much 👍
I am trying to add a Temperature Sensor and am getting the following error at Homebridge startup:
The HomeSeer device is a virtual device I created and update with a script. I have tried setting ScaleText to "F" but got the same error.
How does the plugin determine whether a Temperature Sensor has values in Celsius or Fahrenheit?