Merge lp:~martin-borho/ubuntu-weather-app/weather-data-api into lp:ubuntu-weather-app/obsolete.trunk
Status: | Merged |
---|---|
Approved by: | Michael Hall |
Approved revision: | 10 |
Merged at revision: | 6 |
Proposed branch: | lp:~martin-borho/ubuntu-weather-app/weather-data-api |
Merge into: | lp:ubuntu-weather-app/obsolete.trunk |
Diff against target: |
318 lines (+291/-0) 3 files modified
components/Storage.qml (+68/-0) components/WeatherApi.js (+218/-0) weather.qml (+5/-0) |
To merge this branch: | bzr merge lp:~martin-borho/ubuntu-weather-app/weather-data-api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hall | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+155997@code.launchpad.net |
Commit message
Added first version of Weather-Data-Api and Storage
Description of the change
Added first version of Weather-Data-Api and Storage (for now based on QtQuick.
The WeatherApi can be expanded with other services (see OpenWeatherMapApi object in WeatherApi.js). The response object has 4 properties: obj.location (Location data), obj.current (CurrentCondition), obj.forecast (3-hours-based forecast) and obj.daily (DailyForecast).
The whole API data-response is meant to be saved "as is" in the storage, together with a timestamp.
Missing:
- better error-handling
- proper date handling
- better response format
- ...
For a complete cycle of location searching, requesting data from openweathermap.org and storage related actions copy the following to your weather.qml:
function onApiError(err) {
}
function onSearchSuccess
})
}
function search() {
// search
}
function onLocationDataS
});
});
}
function listLocations(
} else {
}
})
} else {
}
})
} else {
}
});
});
}
function requestLocation
// weather data requests
var location = {service: "openweathermap", service_id: 2911298, name: "Hamburg"};
}
Component.
search();
}
PASSED: Continuous integration, rev:10 91.189. 93.125: 8080/job/ ubuntu- weather- app-ci/ 2/ 91.189. 93.125: 8080/job/ ubuntu- weather- app-quantal- amd64-ci/ 2/console 91.189. 93.125: 8080/job/ ubuntu- weather- app-raring- amd64-ci/ 2/console
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.125: 8080/job/ ubuntu- weather- app-ci/ 2/rebuild
http://