Pirate-Weather / pirateweather

Code and documentation for the Pirate Weather API
Apache License 2.0
670 stars 30 forks source link

Bug: Temperatures are reportet in °F instead of °C #71

Closed msinn closed 1 year ago

msinn commented 1 year ago

The api documentation states, that the temperatures are reported in °C (and in the pastbthey were). Now temperatures (at least formthe current conditions) are reported in °F

alexander0042 commented 1 year ago

Hi, Thanks for opening this issue, since getting units right is pretty key! Looking at the docs, and from what Dark Sky did, I believe temperature should be reported in F by default (https://docs.pirateweather.net/en/latest/API/#units_1). If you'd like to get it in C, there's a "units" URL parameter that can be used

msinn commented 1 year ago

I reported th issue, because pirateweather was delivering the temperatures in °C and your own documentation says so too.

alexander0042 commented 1 year ago

Sorry, I don't think I'm fully understanding here. When the API is called without URL parameters, it returns the temperature in F, so that appears to be correct. Reading the docs, is says: "For compatibility with Dark Sky, us (Imperial units) are the default if nothing is specified", which also indicates it's in F.

msinn commented 1 year ago

I had right temperatures in my home automation and without any modifications on my side they switched to °F. I cannot say when it happended.

Btw.: I call the api to get metric units and windspeeds are reported in km/h.

alexander0042 commented 1 year ago

Ok, that helps! So you're using the HACS Pirate Weather Integration?

msinn commented 1 year ago

You lost me. What is HACS?

msinn commented 1 year ago

I am one of the core developers of an smarthome integration system called SmartHomeNG. I wrote a plugin for darksky and created a modified version of it for pirateweather as darksky was shutting down.

alexander0042 commented 1 year ago

I think I've got it- you're running a slightly modified version of the original Dark Sky integration, and it's switched to providing temperatures in F rather than C?

msinn commented 1 year ago

I am using ca as units when calling the pirateweather api

ca: SI, with Wind Speed and Wind Gust in kilometres per hour.

It used to return temperatures in °C but now it returnes temperatures in °F. I don‘t know when that changed. It was noticed last weekend.

papauschek commented 1 year ago

I see the same behavior. I am passing "ca" as the units value and was - until recently - getting C° returned. Since 1 or 2 days, this has changed to F°. How to get back to C° ?

alexander0042 commented 1 year ago

OK. so definitely something going on here, but it's tricky for me to reproduce. Do you mind passing along the URL string that you're passing with the API Key redacted?

papauschek commented 1 year ago

Very strange. I cannot seem to reproduce it on my local development setup. The issue happens only on my raspberry pi (Chromium browser). Is it possible that certain request headers / browser headers can override the units parameter?

I will try to get an exact request/response log with the actual headers to try and reproduce the issue, but might not get around to it until later this week.

papauschek commented 1 year ago

Now its back to C°. Sorry could not reproduce it anymore. If it happens again, I'll try. :D

alexander0042 commented 1 year ago

Thanks for the update! I'm going to close this for now to keep things tidy, but please feel free to re-open if it crops up again