Idea

mtnscott avatar image
mtnscott suggested

Temperature Sensor support for Farenheit scale

I thought I would post this simple change to enable support for showing "°F" when wanting to display temperature using a Fahrenheit scale.


The change is in the venus QML file PageTemperatureSensor.qml

First add the following binding:

VBusItem {
   id: temperatureScale
   bind: service.path("/Scale")
}

Then change the following line:

item.unit: "°C"

To this:

item.unit: temperatureScale.value == '1' ? "°C" : "°F"

The logic will just check if the scale is = 1. If so, it will continue to use the Celsius representation, otherwise it will assume Fahrenheit. If anyone wanted to display in Kelvin we could add more logic to the offset but not sure anyone wants to do that ;)


It's a simple change and I'm happy to do a PR for is just not sure where and who I should interact with. It would be nice to have this in the code base for future updates!


Venus OStemperature
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Warwick Bruce Chapman avatar image
Warwick Bruce Chapman commented

Neat but perhaps US can just make the switch to metric instead?

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

pau1phi11ips avatar image pau1phi11ips commented ·

It's not gonna happen tho is it. I'm from the UK and we still use the ludicrous imperial system for some stuff.

0 Likes 0 ·
Kevin Windrem avatar image
Kevin Windrem commented

I couldn't get this to work !!

/Scale is not an F/C selection. It and /Offest are calibration values. I'm not sure all temperature sensors have the calibration parameters.

As far as I can tell, there is no system-wide selection for F/C. Not sure about each temperature sensor.

I also tried changing item.unit to "°F" and it changed the text but the actual value was still in Centigrade.

I'm showing both C and F and had to compute the value for F in line.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.