{"action":"created","comment":{"url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/comments/63721722","id":63721722,"diff_hunk":"@@ -52,28 +52,45 @@ def __init__(self):\n         # Update process Popen object\n         self.process = None\n \n+    def get_settings_defaults(self):\n+        return dict(\n+            auto_update=True\n+        )\n+\n     def get_assets(self):\n         return {\n-            \"js\": [\"js/firmwareupdate.js\"]\n+            \"js\": [\"js/firmwareupdate.js\"],\n+            \"css\": [\"css/style.css\"]\n         }\n \n     def get_api_commands(self):\n         return dict(\n-            update_firmware=[]\n+            update_firmware=[],\n+            toggle_auto_update=[]\n         )\n \n     def on_api_command(self, command, data):\n         if command == \"update_firmware\":\n             self._start_update()\n-\n+        elif command == \"toggle_auto_update\":\n+            if data['current']:\n+                auto_update = False\n+            else:\n+                auto_update = True\n+            self._settings.set_boolean([\"auto_update\"], auto_update)\n+            self._settings.save()\n+            eventManager().fire(Events.SETTINGS_UPDATED)\n         else:\n             self._logger.info(\"Unknown command: \" + command)\n \n     def on_api_get(self, request):\n         return flask.jsonify(isUpdating=self.isUpdating)\n \n     def on_after_startup(self):\n-        self._start_update(True)\n+        if self._settings.get_boolean([\"auto_update\"]):","path":"octoprint_firmwareupdate/__init__.py","position":43,"original_position":43,"commit_id":"dd1bc2e5a51d871efbd767fc1c54cd58e55ac740","original_commit_id":"dd1bc2e5a51d871efbd767fc1c54cd58e55ac740","user":{"login":"jencheng","id":1734048,"avatar_url":"https://avatars.githubusercontent.com/u/1734048?v=3","gravatar_id":"","url":"https://api.github.com/users/jencheng","html_url":"https://github.com/jencheng","followers_url":"https://api.github.com/users/jencheng/followers","following_url":"https://api.github.com/users/jencheng/following{/other_user}","gists_url":"https://api.github.com/users/jencheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jencheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jencheng/subscriptions","organizations_url":"https://api.github.com/users/jencheng/orgs","repos_url":"https://api.github.com/users/jencheng/repos","events_url":"https://api.github.com/users/jencheng/events{/privacy}","received_events_url":"https://api.github.com/users/jencheng/received_events","type":"User","site_admin":false},"body":"🆗 ","created_at":"2016-05-18T15:10:07Z","updated_at":"2016-05-18T15:10:07Z","html_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate/pull/8#discussion_r63721722","pull_request_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/comments/63721722"},"html":{"href":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate/pull/8#discussion_r63721722"},"pull_request":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/8","id":69843011,"html_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate/pull/8","diff_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate/pull/8.diff","patch_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate/pull/8.patch","issue_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues/8","number":8,"state":"open","locked":false,"title":"Add setting to enable/disable auto-updating on startup","user":{"login":"kevingelion","id":10536167,"avatar_url":"https://avatars.githubusercontent.com/u/10536167?v=3","gravatar_id":"","url":"https://api.github.com/users/kevingelion","html_url":"https://github.com/kevingelion","followers_url":"https://api.github.com/users/kevingelion/followers","following_url":"https://api.github.com/users/kevingelion/following{/other_user}","gists_url":"https://api.github.com/users/kevingelion/gists{/gist_id}","starred_url":"https://api.github.com/users/kevingelion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevingelion/subscriptions","organizations_url":"https://api.github.com/users/kevingelion/orgs","repos_url":"https://api.github.com/users/kevingelion/repos","events_url":"https://api.github.com/users/kevingelion/events{/privacy}","received_events_url":"https://api.github.com/users/kevingelion/received_events","type":"User","site_admin":false},"body":"cc: @jminardi ","created_at":"2016-05-12T14:09:33Z","updated_at":"2016-05-18T15:10:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"395ff836aa590ce0265951f551d8a76e46dd29df","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/8/commits","review_comments_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/8/comments","review_comment_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues/8/comments","statuses_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/statuses/dd1bc2e5a51d871efbd767fc1c54cd58e55ac740","head":{"label":"Voxel8:settings","ref":"settings","sha":"dd1bc2e5a51d871efbd767fc1c54cd58e55ac740","user":{"login":"Voxel8","id":8389280,"avatar_url":"https://avatars.githubusercontent.com/u/8389280?v=3","gravatar_id":"","url":"https://api.github.com/users/Voxel8","html_url":"https://github.com/Voxel8","followers_url":"https://api.github.com/users/Voxel8/followers","following_url":"https://api.github.com/users/Voxel8/following{/other_user}","gists_url":"https://api.github.com/users/Voxel8/gists{/gist_id}","starred_url":"https://api.github.com/users/Voxel8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voxel8/subscriptions","organizations_url":"https://api.github.com/users/Voxel8/orgs","repos_url":"https://api.github.com/users/Voxel8/repos","events_url":"https://api.github.com/users/Voxel8/events{/privacy}","received_events_url":"https://api.github.com/users/Voxel8/received_events","type":"Organization","site_admin":false},"repo":{"id":45130312,"name":"OctoPrint-FirmwareUpdate","full_name":"Voxel8/OctoPrint-FirmwareUpdate","owner":{"login":"Voxel8","id":8389280,"avatar_url":"https://avatars.githubusercontent.com/u/8389280?v=3","gravatar_id":"","url":"https://api.github.com/users/Voxel8","html_url":"https://github.com/Voxel8","followers_url":"https://api.github.com/users/Voxel8/followers","following_url":"https://api.github.com/users/Voxel8/following{/other_user}","gists_url":"https://api.github.com/users/Voxel8/gists{/gist_id}","starred_url":"https://api.github.com/users/Voxel8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voxel8/subscriptions","organizations_url":"https://api.github.com/users/Voxel8/orgs","repos_url":"https://api.github.com/users/Voxel8/repos","events_url":"https://api.github.com/users/Voxel8/events{/privacy}","received_events_url":"https://api.github.com/users/Voxel8/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate","description":"Update Voxel8's 3D Printer firmware via OctoPrint","fork":false,"url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate","forks_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/forks","keys_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/teams","hooks_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/hooks","issue_events_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues/events{/number}","events_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/events","assignees_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/assignees{/user}","branches_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/branches{/branch}","tags_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/tags","blobs_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/refs{/sha}","trees_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/statuses/{sha}","languages_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/languages","stargazers_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/stargazers","contributors_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/contributors","subscribers_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/subscribers","subscription_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/subscription","commits_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/commits{/sha}","git_commits_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/commits{/sha}","comments_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/comments{/number}","issue_comment_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues/comments{/number}","contents_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/contents/{+path}","compare_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/merges","archive_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/downloads","issues_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues{/number}","pulls_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls{/number}","milestones_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/milestones{/number}","notifications_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/labels{/name}","releases_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/releases{/id}","deployments_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/deployments","created_at":"2015-10-28T17:34:14Z","updated_at":"2016-04-24T23:10:11Z","pushed_at":"2016-05-16T17:22:51Z","git_url":"git://github.com/Voxel8/OctoPrint-FirmwareUpdate.git","ssh_url":"git@github.com:Voxel8/OctoPrint-FirmwareUpdate.git","clone_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate.git","svn_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Voxel8:master","ref":"master","sha":"6ab053864f0f05e28cdaf2501c7607085c469627","user":{"login":"Voxel8","id":8389280,"avatar_url":"https://avatars.githubusercontent.com/u/8389280?v=3","gravatar_id":"","url":"https://api.github.com/users/Voxel8","html_url":"https://github.com/Voxel8","followers_url":"https://api.github.com/users/Voxel8/followers","following_url":"https://api.github.com/users/Voxel8/following{/other_user}","gists_url":"https://api.github.com/users/Voxel8/gists{/gist_id}","starred_url":"https://api.github.com/users/Voxel8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voxel8/subscriptions","organizations_url":"https://api.github.com/users/Voxel8/orgs","repos_url":"https://api.github.com/users/Voxel8/repos","events_url":"https://api.github.com/users/Voxel8/events{/privacy}","received_events_url":"https://api.github.com/users/Voxel8/received_events","type":"Organization","site_admin":false},"repo":{"id":45130312,"name":"OctoPrint-FirmwareUpdate","full_name":"Voxel8/OctoPrint-FirmwareUpdate","owner":{"login":"Voxel8","id":8389280,"avatar_url":"https://avatars.githubusercontent.com/u/8389280?v=3","gravatar_id":"","url":"https://api.github.com/users/Voxel8","html_url":"https://github.com/Voxel8","followers_url":"https://api.github.com/users/Voxel8/followers","following_url":"https://api.github.com/users/Voxel8/following{/other_user}","gists_url":"https://api.github.com/users/Voxel8/gists{/gist_id}","starred_url":"https://api.github.com/users/Voxel8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voxel8/subscriptions","organizations_url":"https://api.github.com/users/Voxel8/orgs","repos_url":"https://api.github.com/users/Voxel8/repos","events_url":"https://api.github.com/users/Voxel8/events{/privacy}","received_events_url":"https://api.github.com/users/Voxel8/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate","description":"Update Voxel8's 3D Printer firmware via OctoPrint","fork":false,"url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate","forks_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/forks","keys_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/teams","hooks_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/hooks","issue_events_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues/events{/number}","events_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/events","assignees_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/assignees{/user}","branches_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/branches{/branch}","tags_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/tags","blobs_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/refs{/sha}","trees_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/statuses/{sha}","languages_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/languages","stargazers_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/stargazers","contributors_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/contributors","subscribers_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/subscribers","subscription_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/subscription","commits_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/commits{/sha}","git_commits_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/git/commits{/sha}","comments_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/comments{/number}","issue_comment_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues/comments{/number}","contents_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/contents/{+path}","compare_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/merges","archive_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/downloads","issues_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues{/number}","pulls_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls{/number}","milestones_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/milestones{/number}","notifications_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/labels{/name}","releases_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/releases{/id}","deployments_url":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/deployments","created_at":"2015-10-28T17:34:14Z","updated_at":"2016-04-24T23:10:11Z","pushed_at":"2016-05-16T17:22:51Z","git_url":"git://github.com/Voxel8/OctoPrint-FirmwareUpdate.git","ssh_url":"git@github.com:Voxel8/OctoPrint-FirmwareUpdate.git","clone_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate.git","svn_url":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/8"},"html":{"href":"https://github.com/Voxel8/OctoPrint-FirmwareUpdate/pull/8"},"issue":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues/8"},"comments":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/Voxel8/OctoPrint-FirmwareUpdate/statuses/dd1bc2e5a51d871efbd767fc1c54cd58e55ac740"}}}}