{"_id":"16x2-lcd-menu","_rev":"2-ebfbe43824b2992ac9fa78070f502436","name":"16x2-lcd-menu","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"16x2-lcd-menu","version":"0.1.0","description":"Library to quickly set up config menus on a 16x2 lcd","main":"index.js","repository":{"type":"git","url":"git+https://github.com/aphotix/16x2-lcd-menu.git"},"keywords":["Adafruit","16x2","Raspberry","Pi"],"author":{"name":"David Tompkins","email":"david@zde.io"},"license":"MIT","bugs":{"url":"https://github.com/aphotix/16x2-lcd-menu/issues"},"homepage":"https://github.com/aphotix/16x2-lcd-menu#readme","dependencies":{"adafruit-i2c-lcd":"^1.0.2"},"gitHead":"93698229040f70d552d21dabd78929e39961f976","_id":"16x2-lcd-menu@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"aphotix","email":"aphotix@gmail.com"},"dist":{"integrity":"sha512-uqNiRDVz14GawE9+kvKScsUkGxfoVWXi/cgLYV/xoNnLRsFbgrXV0lZL1PUztBtrbFkF8AHxxTZ2NVThmoQedA==","shasum":"41008c2ed39eca68f0706e65801cdb7d54b5bcb6","tarball":"https://registry.npmjs.org/16x2-lcd-menu/-/16x2-lcd-menu-0.1.0.tgz","fileCount":6,"unpackedSize":14388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcK8TVCRA9TVsSAnZWagAAyVQP/R705oBPjSpVFCyeBZhe\nddh/ANRNkK0SuvQ7JYPmgxr6Q8EkrA0zDIhoFRxh3A14GVF4i7g5YEye0TSO\nBUV/GEXNnj2Vk5+zN3t6OJHDxQ0MdmiRpXdBkICF80jpvC/1XS8emYviSAr4\nq4IDSnHSnaSyDws8qM64g4lk7zMWpAlOihA3DChYlA39f4DDvBWm96xQAPov\nxv0GxxmSocX+RCApIsqvGhg1D37+1Vp3TBWY4OyMv4MIoXzBrvzsDB4tJHtv\n2REeFSJ1y8lCVI0Yh9ue2uFA/pfEEp7iPSqLLCKPljuvIiBs3EHlmmV7TEeL\nV90uhQOaMUCfvECspHuGCyVnVVcTPgqL9+LA104PRi537K3Kot4Hb4plxEG/\nQHybzpS4NA7ZNhdRmGDfDODOQN4Hk7UL0O9hHsIOyC2w9Tg7CcLzzX2s54Og\nSpShCS2WaAqAbqP0wh7sz2z5lC1tfEivODPonpGPMG0cHvWDRP2vdUeRaXmm\n0tQ14FRruSil4z/0AgXvPG3XAARaYMmCNVibKZH9iAdN8XplajRtxbdhpyvO\nGRVSSclmCXk6wDaBgbyOgSOlXX0ChlviBQfqbepBsJ8JHv98jthUNkrYmv3H\nJQ7XkntM7J/uKdj2U5y0J670psqJPAbf0dzKu46rtc0Ewt3yazhFIyI/uTne\nHmXE\r\n=2zBc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnsIlDSwLOeQgfpF8tQbqf4oO3zk+LJsGusk3Tp365sAIhALfaH/So7hBBabX5D0KU59edyGrpLWpGhOJLunp9TcoR"}]},"maintainers":[{"name":"aphotix","email":"aphotix@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/16x2-lcd-menu_0.1.0_1546372308435_0.34668793872685466"},"_hasShrinkwrap":false},"0.2.0":{"name":"16x2-lcd-menu","version":"0.2.0","description":"Library to quickly set up config menus on a 16x2 lcd","main":"index.js","repository":{"type":"git","url":"git+https://github.com/aphotix/16x2-lcd-menu.git"},"keywords":["Adafruit","16x2","Raspberry","Pi"],"author":{"name":"David Tompkins","email":"david@zde.io"},"license":"MIT","bugs":{"url":"https://github.com/aphotix/16x2-lcd-menu/issues"},"homepage":"https://github.com/aphotix/16x2-lcd-menu#readme","dependencies":{"adafruit-i2c-lcd":"^2.0.0"},"gitHead":"8a35ec6e9aef3a868ffdd9b6793d59c68510e866","_id":"16x2-lcd-menu@0.2.0","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-vKJnHPi5kLGMZPBLT29Fv2KvLSERTFFKpyfmjMDiNSYqxlsKyyut3Y3uwMTsPtgrS/sjBvmPHsvbI8doQ1oomQ==","shasum":"957a5d8d725333fe37be04e5ad8860ee6175b2a6","tarball":"https://registry.npmjs.org/16x2-lcd-menu/-/16x2-lcd-menu-0.2.0.tgz","fileCount":6,"unpackedSize":14388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzKyDCRA9TVsSAnZWagAAlCIP/j8mB1wkCpEzH44wNuV8\n39CFL4+wZ2lUo8WTduaoqQmQ5XkrR0VlJDwp17mw2qBnzTvc4vgBm4B+SyUv\n1XJYg/37a+8MlvFY8hFja9fc8lSslbOiMg30XfhcHtGG6BI6VKl/+FOO99bj\nErk2r5t+XI96BJ2YSip/tDIWtgr3MouwzldO/xMbIkliw/o1EXFF6d7+kD4S\n4IP9Ft4h/d0Eq9D3VTJwg1DmgX01O4dF6m4T35LnQVjk9nPbWwKkI4JgkRTW\ne0We4P8EMCDXjUxiIgiXYo/17R1ES97ToJs2V7c+xmO+3GKSISmLaq6UVdB9\nYZfXDXNn01bqopEk+4jtzOFQjQ30QFistqHgsAc8jluQ4JEteNjUaisys5dj\n8IXY+nsQkxeCfzl7WavqkiJvnC4AyICnYbWYNkhrq0NtFPOcyGWnljwGcroj\n3s2yhmiB30q9WV61eubCHcRZBj/trHh2ev0BMTVUS/5zuTWppvx+S7OP46+j\nfmQS6/8g1hKemvZ5mmXbc6oGLw9+dtBbXU2AaL4hgUN3CKnTjWYeyXurHz4Z\ndsuNti8TAN4A/KdpJYLZu/gGp/7MGhfFeL6fQU7Yx0mrKJ+5I2OTRXV5reF9\nr2BZ+KF1gHaeXVKhMUY7v0s7xy8JQ/WYch7f5y/KGaJXzzsOdmG4pntZMRQ6\nXp83\r\n=n9I0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGaVV+LPygwaqmD6v2NkkC1XF1zvB6yNv0w7kiO0pKPUAiEA5P9EYXr/VvCJKkPqGTnfgjQXCooKDjX+6T2cmWmfGRE="}]},"maintainers":[{"name":"aphotix","email":"aphotix@gmail.com"}],"_npmUser":{"name":"aphotix","email":"aphotix@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/16x2-lcd-menu_0.2.0_1573694594734_0.9734952141515973"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-01T19:51:48.435Z","0.1.0":"2019-01-01T19:51:48.601Z","modified":"2022-04-04T10:11:22.224Z","0.2.0":"2019-11-14T01:23:14.916Z"},"maintainers":[{"name":"aphotix","email":"aphotix@gmail.com"}],"description":"Library to quickly set up config menus on a 16x2 lcd","homepage":"https://github.com/aphotix/16x2-lcd-menu#readme","keywords":["Adafruit","16x2","Raspberry","Pi"],"repository":{"type":"git","url":"git+https://github.com/aphotix/16x2-lcd-menu.git"},"author":{"name":"David Tompkins","email":"david@zde.io"},"bugs":{"url":"https://github.com/aphotix/16x2-lcd-menu/issues"},"license":"MIT","readme":"# 16x2-lcd-menu\r\nLibrary to abstract Adafruit 16x2 Character LCD menus, favors configuration over code for creating menus and screen navigation.\r\n\r\n\r\n### Menu params\r\n```javascript\r\n{\r\n  id: String, // -- identifier\r\n  name: String, // -- Name of template\r\n  enabled: Bool,\r\n  actions: {\r\n    up: func || string || null || undefined, // Action to perform on button up, function, or a string (string name of menu)\r\n    down: func || string || null || undefined, // if null, go up or down a line if template.length > 2\r\n    left: func || string || undefined, // undefined does nothing\r\n    right: func || string || undefined,\r\n    select: func || string || undefined\r\n  },\r\n  template: [String], // array of template string, line by line, since this is an x2 display we join 0 and 1 by \\n\r\n  data: func // function to retrieve data\r\n\r\n}\r\n```\r\n\r\n## Usage\r\n\r\n```javascript\r\nconst LCDMENU = require('16x2-lcd-menu');\r\nconst lcdMenu = new LCDMENU(60, true); // timeout backlight after 60 seconds, debug on\r\n\r\nlcdMenu.addMenu({\r\n  id: 'testMenu',\r\n  name: 'Test Menu',\r\n  enabled: true,\r\n  actions: {\r\n    right: 'testMenu2',\r\n  },\r\n  template: [\r\n    'This is a',\r\n    'Test Menu',\r\n    'Welcome',\r\n    'To the Demo',\r\n  ],\r\n});\r\n\r\nlcdMenu.addMenu({\r\n  id: 'testMenu2',\r\n  name: 'Test Menu',\r\n  enabled: true,\r\n  template: [\r\n    'Test Menu 2'\r\n  ],\r\n  actions: {\r\n    left: 'testMenu',\r\n  },\r\n});\r\n\r\nlcdMenu.init();\r\nprocess.on('exit', lcdMenu.close); // Cleanup\r\n```\r\n\r\n## LCDMENU Methods\r\n\r\n### lcd\r\nRaw access to instantiated lcd plate library\r\n\r\n### addMenu(Menu Object)\r\nAdds a new menu\r\n* if actions are not set, set it to an empty object (if it is truthy but not an object this could cause a crash)\r\n* Defaults the id to match the name if an id is not set\r\n* sets the first menu as the currentMenu (**WIP**)\r\n\r\n### removeMenu(String id)\r\nRemoves menu specified by id\r\n* Does nothing if id not provided or menu with that id doesn't exist.\r\n* fails if there are no more menus registered\r\n\r\n### enableMenu(String id)\r\nEnables the specified menu\r\n\r\n### disableMenu(String id)\r\nDisables the specified menu\r\n\r\n### setBacklight(Boolean state)\r\nTurns the backlight on or off based on state (truthy)\r\n\r\n### timeoutDisplay()\r\n* Times out the display backlight after the configured # of seconds has passed\r\n* does nothing if timeoutMs is set to 0\r\n\r\n### displayTimeout set/get\r\n* Set the display timeout in seconds.\r\n* Doesn't auto-clear previous timer\r\n\r\n### activeMenu set/get\r\n* Set re-renders the display if valid, if not valid, does nothing.\r\n\r\n### init()\r\nInitializes the display\r\n* If no menu is configured, add a default one\r\n* Turn on backlight\r\n* Clears the screen\r\n* Runs render menu\r\n\r\n### renderMenu(String id)\r\nRenders provided or active menu, or 0 indexed menu if none provided\r\n\r\n### clearDisplayTimeout()\r\nClears the timeout so the screen backlight stays on.\r\n\r\n### close()\r\n* Shuts down screen\r\n* Clears screen, turns off backlight, stops polling button presses\r\n","readmeFilename":"README.md"}