{"id":21013803,"url":"https://github.com/pyro2927/pebble-quick-config","last_synced_at":"2025-04-24T03:28:38.679Z","repository":{"id":12806967,"uuid":"15481840","full_name":"pyro2927/Pebble-Quick-Config","owner":"pyro2927","description":"Quick/easy Pebble config page for use with the 2.0 SDK","archived":false,"fork":false,"pushed_at":"2016-04-07T15:42:59.000Z","size":362,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-17T13:16:28.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyro2927.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-27T21:00:37.000Z","updated_at":"2020-03-22T13:51:21.000Z","dependencies_parsed_at":"2022-09-17T00:12:55.261Z","dependency_job_id":null,"html_url":"https://github.com/pyro2927/Pebble-Quick-Config","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyro2927%2FPebble-Quick-Config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyro2927%2FPebble-Quick-Config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyro2927%2FPebble-Quick-Config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyro2927%2FPebble-Quick-Config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyro2927","download_url":"https://codeload.github.com/pyro2927/Pebble-Quick-Config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250554765,"owners_count":21449684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T09:44:13.535Z","updated_at":"2025-04-24T03:28:38.654Z","avatar_url":"https://github.com/pyro2927.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pebble Quick Configuration Website\n\n[Pebble](https://developer.getpebble.com/)'s new [2.0 SDK](https://developer.getpebble.com/2/) supports convenient app configurations.  Setting up a configuration page currently requires setting up a web page with some light Javascript.  This page allows configuration pages to be easily templated with simple GET requests.\n\n## Example\n[Click here to see an example.](http://pebble-config.herokuapp.com/config?title=Quick%20Config\u0026fields=email_Username,password_Pass)\n\n    http://pebble-config.herokuapp.com/config?title=Quick%20Config\u0026fields=email_Username,password_Pass\n\n## Usage\nTo enable confuring of your application, you'll need to add some code to a few files (*these changes are already done in the included sample app*).\n\n#### [appinfo.json](https://github.com/pyro2927/Pebble-Quick-Config/blob/master/quick-config-sample/appinfo.json)\nYou need to add the `configuration` string to the `capabilities` array in `appinfo.json`.\n\n````\n\"capabilities\": [\n  \"configurable\"\n]\n````\nFor convenience, you'll also want to make note of the keys you'll be using in your config.\n\n````\n\"appKeys\": {\n  \"Username\": 0,\n  \"Passwd\": 1\n}\n````\n\n#### [quick-config-sample.c](https://github.com/pyro2927/Pebble-Quick-Config/blob/master/quick-config-sample/src/quick-config-sample.c)\nThe name of your .C file may differ, depending on what you named your project.  You'll want to add an enum that matches the order of your `appKeys` from `appinfo.json`.\n\n````\nenum {\n  CONFIG_USERNAME = 0x0,\n  CONFIG_PASSWD = 0x1\n};\n````\n\n*Note that the naming of the enum isn't important, just the order, though you may want to name them similarly as to not confuse things.*\n\nRegister to receive AppMessages from the JS side:\n\n````\napp_message_register_inbox_received(in_received_handler);\nconst uint32_t inbound_size = 64;\nconst uint32_t outbound_size = 64;\napp_message_open(inbound_size, outbound_size);\n````\n\nand handle the incoming messages, making sure to pull out your config values:\n\n````\nvoid in_received_handler(DictionaryIterator *received, void *context) {\n  // incoming message received\n  Tuple *username_tuple = dict_find(received, CONFIG_USERNAME); //obtain a pointer to our config value\n  if(username_tuple) {\n    text_layer_set_text(text_layer, username_tuple-\u003evalue-\u003ecstring); //display username\n  } else {\n    text_layer_set_text(text_layer, \"Username not found\");\n  }\n}\n````\n\n#### [pebble-js-app.js](https://github.com/pyro2927/Pebble-Quick-Config/blob/master/quick-config-sample/src/js/pebble-js-app.js)\nNow you just need to configure PebbleJS to load up your configuration window and pass back the JSON-ified values:\n\n````\nPebble.addEventListener(\"showConfiguration\",\n  function(e) {\n    Pebble.openURL(\"http://pebble-config.herokuapp.com/config?title=Quick%20Config\u0026fields=email_Username,password_Passwd\"); // our dyanmic configuration page\n  }\n);\nPebble.addEventListener(\"webviewclosed\",\n  function(e) {\n    var configuration = JSON.parse(e.response);\n    Pebble.sendAppMessage(configuration);\n  }\n);\n````\n\n## Sample App\nThe [`quick-config-sample`](https://github.com/pyro2927/Pebble-Quick-Config/tree/master/quick-config-sample) directory hosts an 2.0 SDK [PebbleJS](http://developer.getpebble.com/2/guides/javascript-guide.html) app that uses [AppMessage](http://developer.getpebble.com/2/api-reference/group___app_message.html) to pass configuration values back to PebbleOS.  After the configuration screen is saved, it will present the username in the middle of the Pebble screen.\n\n## Hosting\nCurrently this is hosted at \u003chttp://pebble-config.herokuapp.com/config\u003e, but you can clone it and place it anywhere you like!\n\n## Query Params\nCurrently there are only two query params:\n\n1. title: a URL encoded title to be displayed at the top of the screen\n2. fields: a comma seperated list of fields to display. If the string contains an underscore (*_*), the text preceeding the underscore will be used as the input field type. This is useful for things like *email* or *password*.\n\nMake sure they are URL encoded and appended to \u003chttp://pebble-config.herokuapp.com/config?\u003e\n\n\n## Screenshot\n![](img/screenshot.PNG)\n\n## Thanks\nThanks to:\n\n* webBoxio for [sinatra-heroku-boilerplate](https://github.com/webBoxio/sinatra-heroku-boilerplate)\n* Twitter for [Twitter Bootstrap](http://getbootstrap.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyro2927%2Fpebble-quick-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyro2927%2Fpebble-quick-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyro2927%2Fpebble-quick-config/lists"}