@brenj said in Modules again.....:
timeFormat: int 60 fadeSpeed: int 5
the json data model is if text, then the data is quoted foo:“something”, if numeric, the data is not quoted, bar:60
no ‘int’
@brenj said in Modules again.....:
timeFormat: int 60 fadeSpeed: int 5
the json data model is if text, then the data is quoted foo:“something”, if numeric, the data is not quoted, bar:60
no ‘int’
a module to show/hide would not be hard… but, how will you KNOW that spotify is playing (or has ended)…
does the spotify playing module send notifications of these events?
what is the model being used for both module and helper?
where and how do I declare variables? either global or instance? (not method variables)
in a helper if I declare outside the NodeHelper.create(…), they are truely global, and other helpers will overwrite my variables if the names collide.
the doc also mentions sendSocketNotification, in both directions… module to helper and helper to module(s) (of same name if multiple)…
this.sendSocketNotification(notification, payload)
notification String - The notification identifier.
payload AnyType - Optional. A notification payload.
If you want to send a notification to the node_helper, use the sendSocketNotification(notification, payload). Only the node_helper of this module will receive the socket notification.
and
Each **node helper** has some handy methods which can be helpful building your module.
this.sendSocketNotification(notification, payload)
notification String - The notification identifier.
payload AnyType - Optional. A notification payload.
If you want to send a notification to all your modules, use the sendSocketNotification(notification, payload). Only the module of your module type will receive the socket notification.
and also looks like with MM.getModules(). i can get an object reference to the instances of the other components, and access their public methods…
scheduler->handler.start(viewer_config),
handler->scheduler.next(viewer)
ok, starting to migrate…
questions:
is there a way to communicate across modules? I don’t see a way to have module A request info from module B, and have B’s response only come back to module A.
in my design, only the scheduler knows about the config DB, and HOW to decide if a viewer is needed, or not.
it then tells the viewer manager to start/stop a viewer… the schedulers also is the only one that knows HOW to get the list of images (using the appropriate api of the source location, file, dropbox, etc)
the viewer makes a call to the scheduler to get the next image, and if at the end of the list, it causes another list reload. the viewer doesn’t know where the list came from. the list is just to images.
now, if someone uses the mobile app and changes the data, it MAY be cause to terminate a running viewer, as the filter would no longer cause that particular viewer to be selected…
but… the db change handler is in the viewer scheduler node_helper, and the running viewer list is in the viewer handler node_helper…
looks like I can only do sendnotification, and broadcast to all modules (ugh)
there is a bug in the electron browser that causes the black screen.
i did
npm remove electron
npm install electron@1.7.9
and it works fine now…
someone posted another solution to issue 1243
so, I have this electron/node/javascript extension for another mirror project, which displays images over the mirror page, moving around, like a pong game… the images shown are collected from different sources,
file, dropbox, google drive, one drive (to be finished), based on filtering a calendar (ical) with info stored in a mongo db.
note: these images are in new windows, and do NOT modify the base dom
the images are shown in an electron remote browserwindow, there may be multiple of these presented concurrently, depending on the filtering specified (show pics of my daughter for her birthday, starting 20 days before, next image every minute ), show pics of my trip to rome on its anniversary , starting 2 days before, next image every 20 seconds, … etc…
i have a mobile app for ios and android that does the config of these filters. The app uses a private rest api to get/set/modify/delete the data, and also does mirror discovery on the local wifi network using udp broadcast…
there are really two plugins/modules… one that does the data collection and filter mgmt, and one that does the image displaying. today these use direct inter instance angular calls… I see I would probably replace these with socket calls.
the scheduler kicks off instances of the imager as required, and terminates when the time window is no longer valid, or the calendar entry list doesn’t contain an entry that matches the active filters.
is there any reason any of this won’t work?
thanks
i did
npm remove electron
npm install electron@1.7.9
and my black screen is gone