genebean / PiWeatherRock

Displays local weather on a Raspberry Pi
https://piweatherrock.technicalissues.us
MIT License
50 stars 23 forks source link

Metric Display #3

Closed iamkhris closed 4 years ago

iamkhris commented 6 years ago

Any way to get this to display temperatures/values in metric?

ssamjh commented 5 years ago

Also curious about this. Had a look through and can't see how to change it.

andyshilton commented 5 years ago

You can alter the call to the darksky API to achieve this. Look for the following around about line199 in weather.py:

self.weather = forecast(config.DS_API_KEY,
                                        config.LAT,
                                        config.LON,
                                        exclude='minutely')

This is the call and it can be adjusted as per the instructions here:

https://darksky.net/dev/docs I prefer the "uk2" style which uses celcius for temps and miles for wind speeds etc, so I altered the API call to be the following and it works fine:

self.weather = forecast(config.DS_API_KEY,
                                        config.LAT,
                                        config.LON,
                                        exclude='minutely',
                                        units='uk2')
genebean commented 5 years ago

Sorry I didn’t see this sooner. I’ll look at adding a confit flag for metric.

andyshilton commented 5 years ago

@genebean Thanks. Love the display! Got it on the wall at work.

genebean commented 4 years ago

I am working on this but still have some bits to figure out. Here is the status https://github.com/genebean/PiWeatherRock/compare/metric

genebean commented 4 years ago

The main thing I need to figure out is how I want to determine when to show mph vs kph and the like

genebean commented 4 years ago

If you all have any additional requests for making this work better when using something other than us for units please let me know.