Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # MMM-page-indicator
  2. ![Example of MMM-page-indicator](./example_picture.png)
  3. This [MagicMirror²][mm] Module is designed indicate what "page" you are looking at. This module is designed to be an indicator only. By itself, it only offers a basic way to change the page, by clicking on the circle indicative of the page you wish to change to.
  4. ## Installation
  5. In your terminal, go to your MagicMirror's Module folder:
  6. ```bash
  7. cd ~/MagicMirror/modules
  8. ```
  9. Clone this repository:
  10. ```bash
  11. git clone https://github.com/edward-shen/MMM-page-indicator.git
  12. ```
  13. Configure the module in your config.js file.
  14. ## Sending notifications to the module
  15. This module responds to the notification `PAGE_CHANGED`. The payload should be an `integer`. Note that this has strict error checking, so `"3"` will not work, while `3` will. Also do note that to switch to page 1, you need to send `0` to the module. **This uses a zero-based numbering system.**
  16. Let's say that you want to change the indicator to page 3. In your code, you would write:
  17. ```js
  18. this.sendNotification("PAGE_CHANGED", 2);
  19. ```
  20. This would cause the module to change show that you are on page 3.
  21. If you wish to change the number of pages, you need to send a `MAX_PAGES_CHANGED` notification with your payload as an integer.
  22. ```js
  23. this.sendNotification("MAX_PAGES_CHANGED", 4);
  24. ```
  25. This would now show that there are now 4 pages to display.
  26. You can also just send `PAGE_INCREMENT` or `PAGE_DECREMENT` without any payloads (or with, but it will be ignored) to have the module change the displayed page by one.
  27. ## Using the module
  28. To use this module, add it to the modules array in the `config/config.js` file:
  29. ```js
  30. modules: [
  31. {
  32. module: 'MMM-page-indicator',
  33. position: 'bottom_bar',
  34. config: {
  35. pages: 3,
  36. }
  37. }
  38. ]
  39. ```
  40. ## Configuration options
  41. Option|Description
  42. ------|-----------
  43. `pages`|Number of pages that you have.<br/>**Expected Value type:** `int`.
  44. `activeBright`|Should the active circle be bright.<br/>**Expected Value type:** `boolean`.
  45. `inactiveDimmed`|Should the inactive circles be dimmed?<br/>**Expected Value type:** `boolean`.
  46. `inactiveHollow`|Should the inactive circles be hollow?<br/>**Expected Value type:** `boolean`.
  47. ## FAQ
  48. - Help! My module is (above/below) another module in the same region but I want it to be somewhere else!
  49. The order of your `config.js` determines your module location. If you have two modules, both with `position:bottom_bar`, the one that is first listed will appear on top. The rest will appear in the same order you defined them in. If you want this module to be at the very bottom, define this module as the last module in your `config.js` file. If you want it to be on top in that region, make sure no other module is defined before it that has the same region.
  50. - Can I make a pull request?
  51. Please do! I'd love for this to be integrated in many modules!
  52. - I want more config options!
  53. Please make an issue. Thanks!
  54. [mm]: https://github.com/MichMich/MagicMirror