Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

weather_current.js 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. const _ = require("lodash");
  2. /**
  3. * @param {object} extendedData extra data to add to the default mock data
  4. * @returns {string} mocked current weather data
  5. */
  6. function generateWeather(extendedData = {}) {
  7. return JSON.stringify(
  8. _.merge(
  9. {},
  10. {
  11. coord: {
  12. lon: 11.58,
  13. lat: 48.14
  14. },
  15. weather: [
  16. {
  17. id: 615,
  18. main: "Snow",
  19. description: "light rain and snow",
  20. icon: "13d"
  21. },
  22. {
  23. id: 500,
  24. main: "Rain",
  25. description: "light rain",
  26. icon: "10d"
  27. }
  28. ],
  29. base: "stations",
  30. main: {
  31. temp: 1.49,
  32. pressure: 1005,
  33. humidity: 93.7,
  34. temp_min: 1,
  35. temp_max: 2
  36. },
  37. visibility: 7000,
  38. wind: {
  39. speed: 11.8,
  40. deg: 250
  41. },
  42. clouds: {
  43. all: 75
  44. },
  45. dt: 1547387400,
  46. sys: {
  47. type: 1,
  48. id: 1267,
  49. message: 0.0031,
  50. country: "DE",
  51. sunrise: 1547362817,
  52. sunset: 1547394301
  53. },
  54. id: 2867714,
  55. name: "Munich",
  56. cod: 200
  57. },
  58. extendedData
  59. )
  60. );
  61. }
  62. module.exports = generateWeather;