Open McNose opened 3 years ago
Ah..sorry. maybe it is getting late already. If I am right, the module recognizes which other module is touched by me and changes the mode? That would be awesome. And no more buttons would be necessary.
So guess i will have a sleep now and another deeper look tomorrow.
Regards
Ok. Seems like now I got it how the module works. Great stuff. Thanks for sharing. But I still got two questions.
Thanks a lot.
Been on other projects for some time now and did not see this issue. I will get back to you next week.
No problem. Take your time.
Have you looked at the "notes" file in the project? What you might want to use is autoMode and use a value of "module" which will set the mode to whichever module owns the screen real estate that was touched.
I don't believe there is such a bug that you describe at this time. There was an issue that I just merged when modules were disabled (was not checking for validity of the array index). Could be that you hit that.
Could you please explain the auto mode a bit more. Especially the example:
autoMode: ["swipe_page_override","nytimes","module"]
I just wrote:
autoMode: "module"
, which seems to work fine with my newsfeed-modules. But what is the rest of your example code?
Besides this: Is there a way to change the gestureCommand for particular icons, buttons or areas of a module? I am thinking of a floorplan with some bulbs on it, to control my smart home.
Thx for helping Great work!
I only used MM briefly, and some time ago now. Moved on to another platform.
autoMode: “module” checks over which module a touch event is actually happening and sets the current mode to that module. If the touch does not occur over any module at all, then the current mode is retained. This allows the NYT to pop up full screen, and then use a gesture to leave full screen.
autoMode: “instanceId” instead uses the module's optional instanceId as the current mode.
If you are going to modify code, you might as well add instanceId to newsfeed in notificationReceived() so that if an instanceId is passed, it will only pay attention to notifications meant for its own instance:
if(payload && payload.hasOwnProperty('instanceId') && (!this.config.instanceId.length || (this.config.instanceId != payload.instanceId))){ return false }
Then in your config add an instanceId entry to each of the newsfeed config entries. You can then name your gesture sections as the instanceId, such as “nytimes” rather than “newsfeed”.
As you are using newsfeed you may notice a bug, in that the headline timer does not reset itself when you move prev/next article manually. https://github.com/MichMich/MagicMirror/issues/2005
I have just seen that Sean is not on duty anymore. So thanks for taking care of this great module now.
I am not very good at programming, but playing around a little helped me understand. However I am wondering if it is possible to create more buttons? Is there a way to modify the code (if necessary just quick and dirty) or do you think I can run multiple instances at the same time?
And one more question: is it possible to change the displayed name to an icon?
Thanks a lot. Mr.Coffee