winleafs / Winleafs

Winleafs: Windows application for Nanoleaf lights
GNU General Public License v3.0
86 stars 9 forks source link

something went wrong when updating the sunrise and sunset times #210

Open Fedefirewall opened 2 years ago

Fedefirewall commented 2 years ago

I can't set the location, either manually or with the "set locatiojn by IP adrress" button, when i press the button it correctly decet the postion and insert the coordinates, but when clcking ok the error message appears A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to options
  2. insert coordinates ( manually or with the button )
  3. click ok
  4. an error appears saying "something went wrong when updating the sunrise and sunset times"

Screenshots

image

Logs Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Purple Rain } } 2022-07-24 21:44:08.3653|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Purple Sun } } 2022-07-24 21:44:08.3863|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Rain 3 } } 2022-07-24 21:44:08.3925|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Sparkling Fire } } 2022-07-24 21:44:08.3925|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Starlight } } 2022-07-24 21:44:08.4053|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Storm Clouds } } 2022-07-24 21:44:08.4053|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Sundown } } 2022-07-24 21:44:08.4053|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Sunlight through trees } } 2022-07-24 21:44:08.4297|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Sunrise } } 2022-07-24 21:44:08.4367|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Sunset } } 2022-07-24 21:44:08.4367|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = TrapPurple } } 2022-07-24 21:44:08.4367|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Vibrant Sunrise } } 2022-07-24 21:44:08.4535|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Vintage Modern } } 2022-07-24 21:44:08.4535|INFO|Winleafs.Api.Endpoints.NanoleafEndpoint|Sending following request to Nanoleaf: Address: http://192.168.1.199:16021/, URL: api/v1/5vuk2gXphB8lkaDwRRVNhe2z1s2bfJEr/effects, Method: PUT, Body: { write = { command = request, animName = Waterfall } } 2022-07-24 21:44:13.1643|INFO|Winleafs.Server.Endpoints.WinleafsServerEndpoint|Sending following request Winleafs Server: Address: https://api.winleafs.com/, URL: /spotify/is-connected/5d080bad-c12b-41e7-b6ed-22942be9e3ea, Method: GET, Body:

Fedefirewall commented 2 years ago

I dont know anyting about C# but i think the problem is this line var sunTimes = client.GetSunsetSunriseAsync(latitude, longitude).GetAwaiter().GetResult() in Winleafs.Wpf\Views\Options\OptionsWindow.xaml.cs

when i removed this line and passed manually the values it works, so i changed the next line from UserSettings.Settings.UpdateSunriseSunset(sunTimes.SunriseHour, sunTimes.SunriseMinute, sunTimes.SunsetHour, sunTimes.SunsetMinute); to UserSettings.Settings.UpdateSunriseSunset(6, 0, 18, 0);

hopes this can help