Start cleaning up some jsdoc

This commit is contained in:
veeck 2021-07-06 10:03:41 +02:00
parent 2619f92d09
commit 36d6a5bc15

View File

@ -70,6 +70,7 @@ WeatherProvider.register("smhi", {
* Of all the times returned find out which one is closest to the current time, should be the first if the data isn't old. * Of all the times returned find out which one is closest to the current time, should be the first if the data isn't old.
* *
* @param times * @param times
* @returns {undefined}
*/ */
getClosestToCurrentTime(times) { getClosestToCurrentTime(times) {
let now = moment(); let now = moment();
@ -85,6 +86,8 @@ WeatherProvider.register("smhi", {
/** /**
* Get the forecast url for the configured coordinates * Get the forecast url for the configured coordinates
*
* @returns {string}
*/ */
getURL() { getURL() {
let lon = this.config.lon; let lon = this.config.lon;
@ -99,8 +102,7 @@ WeatherProvider.register("smhi", {
* *
* @param weatherData * @param weatherData
* @param coordinates * @param coordinates
* @param weatherData * @returns {WeatherObject}
* @param coordinates
*/ */
convertWeatherDataToObject(weatherData, coordinates) { convertWeatherDataToObject(weatherData, coordinates) {
let currentWeather = new WeatherObject("metric", "metric", "metric"); //Weather data is only for Sweden and nobody in Sweden would use imperial let currentWeather = new WeatherObject("metric", "metric", "metric"); //Weather data is only for Sweden and nobody in Sweden would use imperial
@ -145,8 +147,7 @@ WeatherProvider.register("smhi", {
* *
* @param allWeatherData * @param allWeatherData
* @param coordinates * @param coordinates
* @param allWeatherData * @returns {*[]}
* @param coordinates
*/ */
convertWeatherDataGroupedByDay(allWeatherData, coordinates) { convertWeatherDataGroupedByDay(allWeatherData, coordinates) {
let currentWeather; let currentWeather;
@ -194,6 +195,7 @@ WeatherProvider.register("smhi", {
* Resolve coordinates from the response data (probably preferably to use this if it's not matching the config values exactly) * Resolve coordinates from the response data (probably preferably to use this if it's not matching the config values exactly)
* *
* @param data * @param data
* @returns {{lon, lat}}
*/ */
resolveCoordinates(data) { resolveCoordinates(data) {
return { lat: data.geometry.coordinates[0][1], lon: data.geometry.coordinates[0][0] }; return { lat: data.geometry.coordinates[0][1], lon: data.geometry.coordinates[0][0] };
@ -203,6 +205,7 @@ WeatherProvider.register("smhi", {
* Checks if the weatherObject is at dayTime. * Checks if the weatherObject is at dayTime.
* *
* @param weatherObject * @param weatherObject
* @returns {boolean}
*/ */
isDayTime(weatherObject) { isDayTime(weatherObject) {
return weatherObject.date.isBetween(weatherObject.sunrise, weatherObject.sunset, undefined, "[]"); return weatherObject.date.isBetween(weatherObject.sunrise, weatherObject.sunset, undefined, "[]");
@ -213,6 +216,7 @@ WeatherProvider.register("smhi", {
* Find these gaps and fill them with the previous hours data to make the data returned a complete set. * Find these gaps and fill them with the previous hours data to make the data returned a complete set.
* *
* @param data * @param data
* @returns {*[]}
*/ */
fillInGaps(data) { fillInGaps(data) {
let result = []; let result = [];
@ -236,8 +240,7 @@ WeatherProvider.register("smhi", {
* *
* @param currentWeatherData * @param currentWeatherData
* @param name * @param name
* @param currentWeatherData * @returns {unknown}
* @param name
*/ */
paramValue(currentWeatherData, name) { paramValue(currentWeatherData, name) {
return currentWeatherData.parameters.filter((p) => p.name === name).flatMap((p) => p.values)[0]; return currentWeatherData.parameters.filter((p) => p.name === name).flatMap((p) => p.values)[0];
@ -250,8 +253,7 @@ WeatherProvider.register("smhi", {
* *
* @param input * @param input
* @param isDayTime * @param isDayTime
* @param input * @returns {string|string}
* @param isDayTime
*/ */
convertWeatherType(input, isDayTime) { convertWeatherType(input, isDayTime) {
switch (input) { switch (input) {