import weewx

if event.record['usUnits'] == weewx.US:
    event.record['extraTemp1'] = ( cpu.temperature * 1.8 ) + 32
else:
    event.record['extraTemp1'] = cpu.temperature

-tk


On Wed, Mar 18, 2020 at 8:38 AM Mike Revitt <[email protected]> wrote:

> Thanks Thomas,
>
> Was looking at that but didn't know how, my Raspberry Pi reports the
> temperature in Celsius and the database is in Fahrenheit and obviously a
> check would be best.
>
> But how to do that easily?
>
>
> On Wednesday, March 18, 2020 at 2:14:32 PM UTC, Thomas Keffer wrote:
>>
>> Well done!
>>
>> However, your extension makes the assumption that the archive record is
>> always in US Customary. Best to put a check in there before doing the
>> conversion.
>>
>> -tk
>>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/0cd4a4b2-bf30-4f34-a567-4bff9120903f%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/0cd4a4b2-bf30-4f34-a567-4bff9120903f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEDHdLg3cUT5yvXo2fdPXYU_kq9rRTUA_8jS8PHbjT_MTw%40mail.gmail.com.

Reply via email to