mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
add .gitattributes and fix prettier/js warnings (#3094)
see title, as discussed in https://github.com/MichMich/MagicMirror/pull/3093
This commit is contained in:
@@ -194,7 +194,6 @@ WeatherProvider.register("openmeteo", {
|
||||
|
||||
/**
|
||||
* Overrides method for setting config to check if endpoint is correct for hourly
|
||||
*
|
||||
* @param {object} config The configuration object
|
||||
*/
|
||||
setConfig(config) {
|
||||
|
@@ -90,7 +90,6 @@ WeatherProvider.register("openweathermap", {
|
||||
|
||||
/**
|
||||
* Overrides method for setting config to check if endpoint is correct for hourly
|
||||
*
|
||||
* @param {object} config The configuration object
|
||||
*/
|
||||
setConfig(config) {
|
||||
|
@@ -69,7 +69,6 @@ WeatherProvider.register("smhi", {
|
||||
|
||||
/**
|
||||
* Overrides method for setting config with checks for the precipitationValue being unset or invalid
|
||||
*
|
||||
* @param {object} config The configuration object
|
||||
*/
|
||||
setConfig(config) {
|
||||
@@ -82,7 +81,6 @@ 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.
|
||||
*
|
||||
* @param {object[]} times Array of time objects
|
||||
* @returns {object} The weatherdata closest to the current time
|
||||
*/
|
||||
@@ -100,7 +98,6 @@ WeatherProvider.register("smhi", {
|
||||
|
||||
/**
|
||||
* Get the forecast url for the configured coordinates
|
||||
*
|
||||
* @returns {string} the url for the specified coordinates
|
||||
*/
|
||||
getURL() {
|
||||
@@ -115,7 +112,6 @@ WeatherProvider.register("smhi", {
|
||||
|
||||
/**
|
||||
* Calculates the apparent temperature based on known atmospheric data.
|
||||
*
|
||||
* @param {object} weatherData Weatherdata to use for the calculation
|
||||
* @returns {number} The apparent temperature
|
||||
*/
|
||||
@@ -132,7 +128,6 @@ WeatherProvider.register("smhi", {
|
||||
* Converts the returned data into a WeatherObject with required properties set for both current weather and forecast.
|
||||
* The returned units is always in metric system.
|
||||
* Requires coordinates to determine if its daytime or nighttime to know which icon to use and also to set sunrise and sunset.
|
||||
*
|
||||
* @param {object} weatherData Weatherdata to convert
|
||||
* @param {object} coordinates Coordinates of the locations of the weather
|
||||
* @returns {WeatherObject} The converted weatherdata at the specified location
|
||||
@@ -178,7 +173,6 @@ WeatherProvider.register("smhi", {
|
||||
|
||||
/**
|
||||
* Takes all the data points and converts it to one WeatherObject per day.
|
||||
*
|
||||
* @param {object[]} allWeatherData Array of weatherdata
|
||||
* @param {object} coordinates Coordinates of the locations of the weather
|
||||
* @param {string} groupBy The interval to use for grouping the data (day, hour)
|
||||
@@ -230,7 +224,6 @@ WeatherProvider.register("smhi", {
|
||||
/**
|
||||
* Resolve coordinates from the response data (probably preferably to use
|
||||
* this if it's not matching the config values exactly)
|
||||
*
|
||||
* @param {object} data Response data from the weather service
|
||||
* @returns {{lon, lat}} the lat/long coordinates of the data
|
||||
*/
|
||||
@@ -241,7 +234,6 @@ WeatherProvider.register("smhi", {
|
||||
/**
|
||||
* The distance between the data points is increasing in the data the more distant the prediction is.
|
||||
* Find these gaps and fill them with the previous hours data to make the data returned a complete set.
|
||||
*
|
||||
* @param {object[]} data Response data from the weather service
|
||||
* @returns {object[]} Given data with filled gaps
|
||||
*/
|
||||
@@ -263,7 +255,6 @@ WeatherProvider.register("smhi", {
|
||||
|
||||
/**
|
||||
* Helper method to get a property from the returned data set.
|
||||
*
|
||||
* @param {object} currentWeatherData Weatherdata to get from
|
||||
* @param {string} name The name of the property
|
||||
* @returns {*} The value of the property in the weatherdata
|
||||
@@ -276,7 +267,6 @@ WeatherProvider.register("smhi", {
|
||||
* Map the icon value from SMHI to an icon that MagicMirror² understands.
|
||||
* Uses different icons depending on if its daytime or nighttime.
|
||||
* SMHI's description of what the numeric value means is the comment after the case.
|
||||
*
|
||||
* @param {number} input The SMHI icon value
|
||||
* @param {boolean} isDayTime True if the icon should be for daytime, false for nighttime
|
||||
* @returns {string} The icon name for the MagicMirror
|
||||
|
@@ -189,7 +189,6 @@ WeatherProvider.register("ukmetoffice", {
|
||||
|
||||
/**
|
||||
* Generates an url with api parameters based on the config.
|
||||
*
|
||||
* @param {string} forecastType daily or 3hourly forecast
|
||||
* @returns {string} url
|
||||
*/
|
||||
|
@@ -65,7 +65,6 @@ WeatherProvider.register("weatherbit", {
|
||||
|
||||
/**
|
||||
* Overrides method for setting config to check if endpoint is correct for hourly
|
||||
*
|
||||
* @param {object} config The configuration object
|
||||
*/
|
||||
setConfig(config) {
|
||||
|
@@ -75,7 +75,6 @@ class WeatherObject {
|
||||
/**
|
||||
* Determines if the sun sets or rises next. Uses the current time and not
|
||||
* the date from the weather-forecast.
|
||||
*
|
||||
* @param {Moment} date an optional date where you want to get the next
|
||||
* action for. Useful only in tests, defaults to the current time.
|
||||
* @returns {string} "sunset" or "sunrise"
|
||||
@@ -93,7 +92,6 @@ class WeatherObject {
|
||||
|
||||
/**
|
||||
* Checks if the weatherObject is at dayTime.
|
||||
*
|
||||
* @returns {boolean} true if it is at dayTime
|
||||
*/
|
||||
isDayTime() {
|
||||
@@ -105,7 +103,6 @@ class WeatherObject {
|
||||
* Update the sunrise / sunset time depending on the location. This can be
|
||||
* used if your provider doesn't provide that data by itself. Then SunCalc
|
||||
* is used here to calculate them according to the location.
|
||||
*
|
||||
* @param {number} lat latitude
|
||||
* @param {number} lon longitude
|
||||
*/
|
||||
@@ -121,7 +118,6 @@ class WeatherObject {
|
||||
*
|
||||
* Before being handed to other modules, mutable values must be cloned safely.
|
||||
* Especially 'moment' object is not immutable, so original 'date', 'sunrise', 'sunset' could be corrupted or changed by other modules.
|
||||
*
|
||||
* @returns {object} plained object clone of original weatherObject
|
||||
*/
|
||||
simpleClone() {
|
||||
|
@@ -113,7 +113,6 @@ const WeatherProvider = Class.extend({
|
||||
|
||||
/**
|
||||
* A convenience function to make requests.
|
||||
*
|
||||
* @param {string} url the url to fetch from
|
||||
* @param {string} type what contenttype to expect in the response, can be "json" or "xml"
|
||||
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
|
||||
@@ -138,7 +137,6 @@ WeatherProvider.providers = [];
|
||||
|
||||
/**
|
||||
* Static method to register a new weather provider.
|
||||
*
|
||||
* @param {string} providerIdentifier The name of the weather provider
|
||||
* @param {object} providerDetails The details of the weather provider
|
||||
*/
|
||||
@@ -148,7 +146,6 @@ WeatherProvider.register = function (providerIdentifier, providerDetails) {
|
||||
|
||||
/**
|
||||
* Static method to initialize a new weather provider.
|
||||
*
|
||||
* @param {string} providerIdentifier The name of the weather provider
|
||||
* @param {object} delegate The weather module
|
||||
* @returns {object} The new weather provider
|
||||
|
@@ -7,7 +7,6 @@
|
||||
const WeatherUtils = {
|
||||
/**
|
||||
* Convert wind (from m/s) to beaufort scale
|
||||
*
|
||||
* @param {number} speedInMS the windspeed you want to convert
|
||||
* @returns {number} the speed in beaufort
|
||||
*/
|
||||
@@ -25,7 +24,6 @@ const WeatherUtils = {
|
||||
/**
|
||||
* Convert a value in a given unit to a string with a converted
|
||||
* value and a postfix matching the output unit system.
|
||||
*
|
||||
* @param {number} value - The value to convert.
|
||||
* @param {string} valueUnit - The unit the values has. Default is mm.
|
||||
* @param {string} outputUnit - The unit system (imperial/metric) the return value should have.
|
||||
@@ -50,7 +48,6 @@ const WeatherUtils = {
|
||||
/**
|
||||
* Convert temp (from degrees C) into imperial or metric unit depending on
|
||||
* your config
|
||||
*
|
||||
* @param {number} tempInC the temperature in celsius you want to convert
|
||||
* @param {string} unit can be 'imperial' or 'metric'
|
||||
* @returns {number} the converted temperature
|
||||
@@ -61,7 +58,6 @@ const WeatherUtils = {
|
||||
|
||||
/**
|
||||
* Convert wind speed into another unit.
|
||||
*
|
||||
* @param {number} windInMS the windspeed in meter/sec you want to convert
|
||||
* @param {string} unit can be 'beaufort', 'kmh', 'knots, 'imperial' (mph)
|
||||
* or 'metric' (mps)
|
||||
|
Reference in New Issue
Block a user