-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weather API question #9
Comments
I got the same error. The problem for me was the geolocation lookup. I pulled that out and replaced that functionality with static values in the config section at the top. Got the Lat and Lon for my location from https://www.latlong.net/. Here are the changes that I made that fixed it for me. In the Options section at the top of weather.jsx I added these values
Obviously put in what is appropriate for your location. I stripped down the command function to eliminate the calls for the geolocation. Replace the existing function with the following
You should note the code is the same as before, but the geolocation calls are removed. I hope this helps. I am trying to figure out how to get the geolocation to work. I did the permissions to allow Ubersicht access to the location services, but that didn't solve it for me. If I figure that out, I will make the changes and post. |
thanks for the update.
I did the changes but unfortunately the program hangs with Loading… nothing more :-(
maybe you have change to reinvestigate. I appreciate.
… Am 20.11.2023 um 19:06 schrieb wcage03 ***@***.***>:
I got the same error. The problem for me was the geolocation lookup. I pulled that out and replaced that functionality with static values in the config section at the top. Got the Lat and Lon for my location from https://www.latlong.net/ <https://www.latlong.net/>.
Here are the changes that I made that fixed it for me. In the Options section at the top of weather.jsx I added these values
I could not get the geolocation to work on my computer so I entered the values for my city here.
// enter the values for your location
const lat = 33.54
const lon = -86.78
const address = 'Birmingham, AL'
Obviously put in what is appropriate for your location. I stripped down the command function to eliminate the calls for the geolocation. Replace the existing function with the following
export const command = (dispatch) => {
const proxy = 'http://127.0.0.1:41417'
const server = 'https://api.openweathermap.org'
const path = `/data/3.0/onecall?lat=${lat}&lon=${lon}&exclude=minutely&appid=${KEY}&units=${UNITS}&lang=${LANG}`
fetch(`${proxy}/${server}${path}`)
.then((response) => {
return response.json()
})
.catch((error) => {
return dispatch({ type: 'FETCH_FAILED', error: error })
})
.then((data) => {
return dispatch({
type: 'FETCH_SUCCEDED',
data: data,
city: address
})
})
}
You should note the code is the same as before, but the geolocation calls are removed.
Lastly, the widget makes use of the interaction feature. It will open up with only the hourly forecast showing with a triangle for a dropdown. You will need to enable interaction in the Ubersicht preferences to be able to open up and see the 7 day forecast.
I hope this helps. I am trying to figure out how to get the geolocation to work. I did the permissions to allow Ubersicht access to the location services, but that didn't solve it for me. If I figure that out, I will make the changes and post.
—
Reply to this email directly, view it on GitHub <#9 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADT2OVB7PNXWM5JJX65RV7TYFOLYTAVCNFSM6AAAAAAXINCDKGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJZGU3DEMJZGY>.
You are receiving this because you authored the thread.
|
just loaded weather.jsx into widget folder. OpenWeather API key inserted, but widget fails with 176 {data.current.feels_like.toFixed(1)}° listed with "undefined is not an object" comment
The text was updated successfully, but these errors were encountered: