edward-shen / MMM-pages

Add pages to your MagicMirror²!
MIT License
109 stars 29 forks source link

Is this module able to get notification from a python script #32

Closed sgarg15 closed 4 years ago

sgarg15 commented 4 years ago

After tons of research and trying the modules that already exist, i havent able to find any module that works well for using ultrasonic sensors to detect swiping motion. so i am thinking, if i can make a python script that detects a swiping motion, am i able to use that to turn pages on the magicmirror? so if i have something like this

def swiper():
  #code here to detect swipe
  if leftSwipe:
    #send a notification to pages to go left
  if rightSwipe:
    #send a notification to pages to go right

Can the pages module accept notification from a outside source like a python script?

edward-shen commented 4 years ago

This is more of a question regarding interop between modules and external features in general, but for the most part the answer is no, not for any module by itself.

Check out Jopyth/MMM-Remote-Control, specifically their API page which gives provides instructions to use that module as an HTTP proxy to send Magic Mirror notifications. This should provide you with a method to send notifications from Python, through Python's http stdlib, or through the requests library if you want a higher level client.

Let me know if that satisfies your answer.

edward-shen commented 4 years ago

I'm closing this issue due to a lack of response. Please feel free to reopen this issue if you still have a problem.