MagicMirrorOrg/MagicMirror

Architecture suggestion: new “data sources” category

dathbe opened this issue · 0 comments

This would be a larger architectural change for some later major release, but I’m curious to get people’s thoughts on splitting the current modules into two different sections: one for data sources and one for display modules.

The specific issue I’m trying to resolve is minimizing API calls. I have three weather modules (one for alerts, one for a rain map, and one for current weather and forecast). All three draw from OpenWeatherMap API, but none use the same notification name/structure. This results in 3x the API calls, when one should be sufficient.

I think an elegant (though course-changing) solution would be to have a set of data sources that would grab data and present them in notifications, so that the display modules can (should) draw from one or more to present the information in various formats.

This would also help users weed through the modules. Users could look for data sources they’re interested in and then be presented with a narrower list of modules that can display that data source.

And it would help developers by not making them recreate the wheel when a method for collecting the data they want to use.

Probably a pipe dream, but it was a thought I had.