简体   繁体   English

Awareness Snapshot API的天气在各个位置和天气变化中持续数天

[英]Awareness Snapshot API's Weather stuck for days across locations and weather change

When I started looking at getting the weather using the relatively new Snapshot API I was a bit puzzled/concerned when I couldn't find any sort of timestamp on the results being returned. 当我开始使用相对较新的Snapshot API查看天气时,当我找不到返回结果的任何时间戳时,我感到有点困惑/担忧。

I implemented the usage of the API and everything seemed ok for a while. 我实现了API的用法,一段时间后一切似乎正常。 However, now I have been getting the same Weather data for like four days across three very different locations. 但是,现在我已经在三个非常不同的位置连续四天获得了相同的Weather数据。 And the conditions and temperature have indeed not been the same in real life (and another device gave different (correct) data). 实际上,条件和温度实际上并不相同(另一个设备提供了不同的(正确的)数据)。

If you trust the API to deliver you snapshot data with no timestamp or location or anything you really need to be able to trust the data being returned. 如果您信任该API,可以在没有时间戳,位置或任何其他内容的情况下提供快照数据,那么您真正需要的是能够信任返回的数据。

Is this a known issue for the Snapshot API? 这是Snapshot API的已知问题吗? Is there a way to avoid this type of situation to happen? 有办法避免这种情况发生吗? How can you recover when the weather gets stuck like this? 这样的天气卡住了,您如何恢复? And is there some way to know the age and/or location of the data being returned? 是否有某种方法可以知道返回数据的时间和/或位置?

I have debugged the device in question and seen that it isn't the app caching the data and the WeatherResult has status as success. 我调试了有问题的设备,发现它不是用于缓存数据的应用程序, WeatherResult状态为成功。

The API documentation says that weather snapshots are returned at the device's current location. API文档说,天气快照将在设备的当前位置返回。 Having tested it, the weather definitely updates itself if the location changes or every few hours (as opposed to being a known issue). 经过测试后,如果位置发生变化或每隔几个小时(当然不是已知问题),天气肯定会自动更新。

About the second question, if caller needs to know the location, there is a separate API getLocation() which gives that information. 关于第二个问题,如果调用者需要知道位置,则有一个单独的API getLocation()提供该信息。

If "getting stuck" means the returned weather data never changes, a bit more detail on period of waiting or distance traveled will be helpful. 如果“卡住”表示返回的天气数据永不变,则有关等待时间或行驶距离的更多详细信息将很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM