Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture suggestion: new “data sources” category #3404

Open
dathbe opened this issue Mar 25, 2024 · 11 comments
Open

Architecture suggestion: new “data sources” category #3404

dathbe opened this issue Mar 25, 2024 · 11 comments

Comments

@dathbe
Copy link

dathbe commented Mar 25, 2024

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.

@MarcLandis
Copy link
Contributor

Like an hour ago I was thinking about the exact same approach and then I found this request. I absolutly support this.

@bugsounet
Copy link
Contributor

maybe an idea,

  • Define needs from other modules
  • Format an object with data received from the weathers providers used with weather default module (need to create an MagicMirror weather object with max informations when calling weather API)
  • send data in MagicMirror defined format with notification

---> modules can use it

We have coded +/- the same thing with calendar default module

@khassel
Copy link
Collaborator

khassel commented Oct 2, 2024

the default weather module already sends notifications, I'm using the default weather module as data provider here.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 2, 2024

calendar and weather broadcast their data
what else is there?

@dathbe
Copy link
Author

dathbe commented Oct 2, 2024

calendar and weather broadcast their data
what else is there?

  1. There are far more sources of data than calendar and weather.
  2. There are far more sources of calendar and weather data than what is broadcast by the default calendar & weather modules.
  3. Without explicit reference to the calendar and weather modules being data providers, with documentation of what they provide and in what format, other devs have to reverse engineer what those modules (or any other modules) are doing to repurpose it.

There are just two very different things that modules are doing: grabbing data; and displaying it. Various modules and devs have strengths in one or the other.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 2, 2024

alert has no data
compliments data is visible in config
updatenotification no useful data

@dathbe
Copy link
Author

dathbe commented Oct 2, 2024

The default modules are not the only sources of data.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 2, 2024

oh, you want US to build and support a random storage database

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 2, 2024

@bugsounet
weather does all that already

@dathbe
Copy link
Author

dathbe commented Oct 2, 2024

oh, you want US to build and support a random storage database

No, but thanks for the sarcasm.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 2, 2024

@dathbe what other modules provide data that is duplicated by others?

ive been here 7 years and don't see a single other module content consumed by others. plenty of time to become a provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants