{"action":"created","comment":{"url":"https://api.github.com/repos/openrazer/openrazer/pulls/comments/360777140","pull_request_review_id":335723999,"id":360777140,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM2MDc3NzE0MA==","diff_hunk":"@@ -253,16 +253,48 @@ def read_config(self, config_file):\n         for section in ('General', 'Startup', 'Statistics'):\n             self._config[section] = {}\n \n-        self._config['DEFAULT'] = {\n+        self._config['General'] = {\n             'verbose_logging': True,\n+        }\n+        self._config['Startup'] = {\n             'sync_effects_enabled': True,\n             'devices_off_on_screensaver': True,\n-            'key_statistics': False,\n+            'mouse_battery_notifier': True,\n+        }\n+        self._config['Statistics'] = {\n+            'key_statistics': True,\n         }\n \n         if config_file is not None and os.path.exists(config_file):\n             self._config.read(config_file)\n \n+    def write_config(self, config_file):\n+        \"\"\"\n+        Write in the config file\n+\n+        :param config_file: Config file\n+        :type config_file: str or None\n+        \"\"\"\n+        self.logger.debug('Writing config')\n+        self._config['Startup']['sync_effects_enabled'] = 'True' if self.get_sync_effects() else 'False'\n+        self._config['Startup']['devices_off_on_screensaver'] = 'True' if self.get_off_on_screensaver() else 'False'\n+\n+        for device in self._razer_devices:\n+            self._config[device.dbus.storage_name] = {","path":"daemon/openrazer_daemon/daemon.py","position":null,"original_position":33,"commit_id":"1fb7f664c713c337116edadb081eab97d15f30e0","original_commit_id":"a2d2befabf27168d659c34235420ba0074b11c06","user":{"login":"tildearrow","id":13842506,"node_id":"MDQ6VXNlcjEzODQyNTA2","avatar_url":"https://avatars0.githubusercontent.com/u/13842506?v=4","gravatar_id":"","url":"https://api.github.com/users/tildearrow","html_url":"https://github.com/tildearrow","followers_url":"https://api.github.com/users/tildearrow/followers","following_url":"https://api.github.com/users/tildearrow/following{/other_user}","gists_url":"https://api.github.com/users/tildearrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tildearrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildearrow/subscriptions","organizations_url":"https://api.github.com/users/tildearrow/orgs","repos_url":"https://api.github.com/users/tildearrow/repos","events_url":"https://api.github.com/users/tildearrow/events{/privacy}","received_events_url":"https://api.github.com/users/tildearrow/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2019-12-23T06:15:25Z","updated_at":"2019-12-23T06:15:26Z","html_url":"https://github.com/openrazer/openrazer/pull/888#discussion_r360777140","pull_request_url":"https://api.github.com/repos/openrazer/openrazer/pulls/888","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openrazer/openrazer/pulls/comments/360777140"},"html":{"href":"https://github.com/openrazer/openrazer/pull/888#discussion_r360777140"},"pull_request":{"href":"https://api.github.com/repos/openrazer/openrazer/pulls/888"}},"in_reply_to_id":357916469},"pull_request":{"url":"https://api.github.com/repos/openrazer/openrazer/pulls/888","id":302242875,"node_id":"MDExOlB1bGxSZXF1ZXN0MzAyMjQyODc1","html_url":"https://github.com/openrazer/openrazer/pull/888","diff_url":"https://github.com/openrazer/openrazer/pull/888.diff","patch_url":"https://github.com/openrazer/openrazer/pull/888.patch","issue_url":"https://api.github.com/repos/openrazer/openrazer/issues/888","number":888,"state":"open","locked":false,"title":"Add local device state storage (also getEffect methods)","user":{"login":"tildearrow","id":13842506,"node_id":"MDQ6VXNlcjEzODQyNTA2","avatar_url":"https://avatars0.githubusercontent.com/u/13842506?v=4","gravatar_id":"","url":"https://api.github.com/users/tildearrow","html_url":"https://github.com/tildearrow","followers_url":"https://api.github.com/users/tildearrow/followers","following_url":"https://api.github.com/users/tildearrow/following{/other_user}","gists_url":"https://api.github.com/users/tildearrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tildearrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildearrow/subscriptions","organizations_url":"https://api.github.com/users/tildearrow/orgs","repos_url":"https://api.github.com/users/tildearrow/repos","events_url":"https://api.github.com/users/tildearrow/events{/privacy}","received_events_url":"https://api.github.com/users/tildearrow/received_events","type":"User","site_admin":false},"body":"#852. This means:\r\n- When coming back from a Windows machine (where Synapse is installed) your devices will be restored to the last state (effect and settings like DPI).\r\n- Frontends may use the get\\*Effect methods (provided in the pylib as well) to properly display the current effect. Currently:\r\n  - Polychromatic desyncs when changing the effect with a different frontend\r\n  - razerCommander doesn't remember anything.\r\n  - RazerGenie displays the wrong color and effect upon opening\r\n- The getDPI, getPollRate and getBrightness methods (and possible any other getters) will no longer sporadically return 0.\r\n- This allows for fixing the 3 issues mentioned above, and also fixes [this](https://github.com/polychromatic/polychromatic/issues/186), [this](https://github.com/polychromatic/polychromatic/issues/148), [this](https://github.com/polychromatic/polychromatic/issues/60), [this](https://github.com/polychromatic/polychromatic/issues/14), [this](https://github.com/polychromatic/polychromatic/issues/189), [this](https://github.com/openrazer/openrazer/issues/693#issuecomment-437977247), [this](https://github.com/openrazer/openrazer/issues/747#issuecomment-513495112), [this](https://github.com/openrazer/openrazer/issues/540#issuecomment-514605828), [this](https://github.com/GabMus/razerCommander/issues/49), [this](https://github.com/z3ntu/RazerGenie/issues/46), [this](https://github.com/z3ntu/RazerGenie/issues/30), [this](https://github.com/polychromatic/polychromatic/issues/216) and [this](https://github.com/openrazer/openrazer/issues/663), and some other issues I forgot to mention.\r\n\r\nPossible problems:\r\n- Resets your devices to Spectrum on first startup\r\n- Not tested on BlackWidow Ultimate 2013, DeathAdder Chroma, Old Kraken and any device with hardware Starlight effect.\r\n- The Old Kraken and DeathAdder Chroma **do** have effect retrieval methods (and even the Old Kraken has a method with the exact same name as one this PR provides (getCurrentEffect)), but I hope you can let me remove these as they'll become deprecated with this PR.\r\n\r\nAddendum: Yes, it's best to do this in the daemon rather than in the frontends as:\r\n- It works cross-frontend\r\n- Works without any frontend at all as well","created_at":"2019-07-29T21:28:53Z","updated_at":"2019-12-23T06:15:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4fc1753898615b3ee425737f34cf604e6561d915","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":440515173,"node_id":"MDU6TGFiZWw0NDA1MTUxNzM=","url":"https://api.github.com/repos/openrazer/openrazer/labels/In%20Progress","name":"In Progress","color":"E8A317","default":false,"description":null},{"id":284254326,"node_id":"MDU6TGFiZWwyODQyNTQzMjY=","url":"https://api.github.com/repos/openrazer/openrazer/labels/enhancement","name":"enhancement","color":"84b6eb","default":true,"description":null}],"milestone":null,"commits_url":"https://api.github.com/repos/openrazer/openrazer/pulls/888/commits","review_comments_url":"https://api.github.com/repos/openrazer/openrazer/pulls/888/comments","review_comment_url":"https://api.github.com/repos/openrazer/openrazer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openrazer/openrazer/issues/888/comments","statuses_url":"https://api.github.com/repos/openrazer/openrazer/statuses/1fb7f664c713c337116edadb081eab97d15f30e0","head":{"label":"tildearrow:master","ref":"master","sha":"1fb7f664c713c337116edadb081eab97d15f30e0","user":{"login":"tildearrow","id":13842506,"node_id":"MDQ6VXNlcjEzODQyNTA2","avatar_url":"https://avatars0.githubusercontent.com/u/13842506?v=4","gravatar_id":"","url":"https://api.github.com/users/tildearrow","html_url":"https://github.com/tildearrow","followers_url":"https://api.github.com/users/tildearrow/followers","following_url":"https://api.github.com/users/tildearrow/following{/other_user}","gists_url":"https://api.github.com/users/tildearrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tildearrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildearrow/subscriptions","organizations_url":"https://api.github.com/users/tildearrow/orgs","repos_url":"https://api.github.com/users/tildearrow/repos","events_url":"https://api.github.com/users/tildearrow/events{/privacy}","received_events_url":"https://api.github.com/users/tildearrow/received_events","type":"User","site_admin":false},"repo":{"id":199513341,"node_id":"MDEwOlJlcG9zaXRvcnkxOTk1MTMzNDE=","name":"openrazer","full_name":"tildearrow/openrazer","private":false,"owner":{"login":"tildearrow","id":13842506,"node_id":"MDQ6VXNlcjEzODQyNTA2","avatar_url":"https://avatars0.githubusercontent.com/u/13842506?v=4","gravatar_id":"","url":"https://api.github.com/users/tildearrow","html_url":"https://github.com/tildearrow","followers_url":"https://api.github.com/users/tildearrow/followers","following_url":"https://api.github.com/users/tildearrow/following{/other_user}","gists_url":"https://api.github.com/users/tildearrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tildearrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildearrow/subscriptions","organizations_url":"https://api.github.com/users/tildearrow/orgs","repos_url":"https://api.github.com/users/tildearrow/repos","events_url":"https://api.github.com/users/tildearrow/events{/privacy}","received_events_url":"https://api.github.com/users/tildearrow/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tildearrow/openrazer","description":"An entirely open source driver and user-space daemon that allows you to manage your Razer peripherals on GNU/Linux","fork":true,"url":"https://api.github.com/repos/tildearrow/openrazer","forks_url":"https://api.github.com/repos/tildearrow/openrazer/forks","keys_url":"https://api.github.com/repos/tildearrow/openrazer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tildearrow/openrazer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tildearrow/openrazer/teams","hooks_url":"https://api.github.com/repos/tildearrow/openrazer/hooks","issue_events_url":"https://api.github.com/repos/tildearrow/openrazer/issues/events{/number}","events_url":"https://api.github.com/repos/tildearrow/openrazer/events","assignees_url":"https://api.github.com/repos/tildearrow/openrazer/assignees{/user}","branches_url":"https://api.github.com/repos/tildearrow/openrazer/branches{/branch}","tags_url":"https://api.github.com/repos/tildearrow/openrazer/tags","blobs_url":"https://api.github.com/repos/tildearrow/openrazer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tildearrow/openrazer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tildearrow/openrazer/git/refs{/sha}","trees_url":"https://api.github.com/repos/tildearrow/openrazer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tildearrow/openrazer/statuses/{sha}","languages_url":"https://api.github.com/repos/tildearrow/openrazer/languages","stargazers_url":"https://api.github.com/repos/tildearrow/openrazer/stargazers","contributors_url":"https://api.github.com/repos/tildearrow/openrazer/contributors","subscribers_url":"https://api.github.com/repos/tildearrow/openrazer/subscribers","subscription_url":"https://api.github.com/repos/tildearrow/openrazer/subscription","commits_url":"https://api.github.com/repos/tildearrow/openrazer/commits{/sha}","git_commits_url":"https://api.github.com/repos/tildearrow/openrazer/git/commits{/sha}","comments_url":"https://api.github.com/repos/tildearrow/openrazer/comments{/number}","issue_comment_url":"https://api.github.com/repos/tildearrow/openrazer/issues/comments{/number}","contents_url":"https://api.github.com/repos/tildearrow/openrazer/contents/{+path}","compare_url":"https://api.github.com/repos/tildearrow/openrazer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tildearrow/openrazer/merges","archive_url":"https://api.github.com/repos/tildearrow/openrazer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tildearrow/openrazer/downloads","issues_url":"https://api.github.com/repos/tildearrow/openrazer/issues{/number}","pulls_url":"https://api.github.com/repos/tildearrow/openrazer/pulls{/number}","milestones_url":"https://api.github.com/repos/tildearrow/openrazer/milestones{/number}","notifications_url":"https://api.github.com/repos/tildearrow/openrazer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tildearrow/openrazer/labels{/name}","releases_url":"https://api.github.com/repos/tildearrow/openrazer/releases{/id}","deployments_url":"https://api.github.com/repos/tildearrow/openrazer/deployments","created_at":"2019-07-29T19:17:33Z","updated_at":"2019-12-23T06:15:24Z","pushed_at":"2019-12-23T06:15:21Z","git_url":"git://github.com/tildearrow/openrazer.git","ssh_url":"git@github.com:tildearrow/openrazer.git","clone_url":"https://github.com/tildearrow/openrazer.git","svn_url":"https://github.com/tildearrow/openrazer","homepage":"https://openrazer.github.io/","size":9517,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openrazer:master","ref":"master","sha":"6e7be54349ef4df9752544c693ef4f80d269d104","user":{"login":"openrazer","id":25405085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NDA1MDg1","avatar_url":"https://avatars2.githubusercontent.com/u/25405085?v=4","gravatar_id":"","url":"https://api.github.com/users/openrazer","html_url":"https://github.com/openrazer","followers_url":"https://api.github.com/users/openrazer/followers","following_url":"https://api.github.com/users/openrazer/following{/other_user}","gists_url":"https://api.github.com/users/openrazer/gists{/gist_id}","starred_url":"https://api.github.com/users/openrazer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openrazer/subscriptions","organizations_url":"https://api.github.com/users/openrazer/orgs","repos_url":"https://api.github.com/users/openrazer/repos","events_url":"https://api.github.com/users/openrazer/events{/privacy}","received_events_url":"https://api.github.com/users/openrazer/received_events","type":"Organization","site_admin":false},"repo":{"id":45838272,"node_id":"MDEwOlJlcG9zaXRvcnk0NTgzODI3Mg==","name":"openrazer","full_name":"openrazer/openrazer","private":false,"owner":{"login":"openrazer","id":25405085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1NDA1MDg1","avatar_url":"https://avatars2.githubusercontent.com/u/25405085?v=4","gravatar_id":"","url":"https://api.github.com/users/openrazer","html_url":"https://github.com/openrazer","followers_url":"https://api.github.com/users/openrazer/followers","following_url":"https://api.github.com/users/openrazer/following{/other_user}","gists_url":"https://api.github.com/users/openrazer/gists{/gist_id}","starred_url":"https://api.github.com/users/openrazer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openrazer/subscriptions","organizations_url":"https://api.github.com/users/openrazer/orgs","repos_url":"https://api.github.com/users/openrazer/repos","events_url":"https://api.github.com/users/openrazer/events{/privacy}","received_events_url":"https://api.github.com/users/openrazer/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openrazer/openrazer","description":"An entirely open source driver and user-space daemon that allows you to manage your Razer peripherals on GNU/Linux","fork":false,"url":"https://api.github.com/repos/openrazer/openrazer","forks_url":"https://api.github.com/repos/openrazer/openrazer/forks","keys_url":"https://api.github.com/repos/openrazer/openrazer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openrazer/openrazer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openrazer/openrazer/teams","hooks_url":"https://api.github.com/repos/openrazer/openrazer/hooks","issue_events_url":"https://api.github.com/repos/openrazer/openrazer/issues/events{/number}","events_url":"https://api.github.com/repos/openrazer/openrazer/events","assignees_url":"https://api.github.com/repos/openrazer/openrazer/assignees{/user}","branches_url":"https://api.github.com/repos/openrazer/openrazer/branches{/branch}","tags_url":"https://api.github.com/repos/openrazer/openrazer/tags","blobs_url":"https://api.github.com/repos/openrazer/openrazer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openrazer/openrazer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openrazer/openrazer/git/refs{/sha}","trees_url":"https://api.github.com/repos/openrazer/openrazer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openrazer/openrazer/statuses/{sha}","languages_url":"https://api.github.com/repos/openrazer/openrazer/languages","stargazers_url":"https://api.github.com/repos/openrazer/openrazer/stargazers","contributors_url":"https://api.github.com/repos/openrazer/openrazer/contributors","subscribers_url":"https://api.github.com/repos/openrazer/openrazer/subscribers","subscription_url":"https://api.github.com/repos/openrazer/openrazer/subscription","commits_url":"https://api.github.com/repos/openrazer/openrazer/commits{/sha}","git_commits_url":"https://api.github.com/repos/openrazer/openrazer/git/commits{/sha}","comments_url":"https://api.github.com/repos/openrazer/openrazer/comments{/number}","issue_comment_url":"https://api.github.com/repos/openrazer/openrazer/issues/comments{/number}","contents_url":"https://api.github.com/repos/openrazer/openrazer/contents/{+path}","compare_url":"https://api.github.com/repos/openrazer/openrazer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openrazer/openrazer/merges","archive_url":"https://api.github.com/repos/openrazer/openrazer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openrazer/openrazer/downloads","issues_url":"https://api.github.com/repos/openrazer/openrazer/issues{/number}","pulls_url":"https://api.github.com/repos/openrazer/openrazer/pulls{/number}","milestones_url":"https://api.github.com/repos/openrazer/openrazer/milestones{/number}","notifications_url":"https://api.github.com/repos/openrazer/openrazer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openrazer/openrazer/labels{/name}","releases_url":"https://api.github.com/repos/openrazer/openrazer/releases{/id}","deployments_url":"https://api.github.com/repos/openrazer/openrazer/deployments","created_at":"2015-11-09T13:03:19Z","updated_at":"2019-12-22T21:43:52Z","pushed_at":"2019-12-23T06:15:23Z","git_url":"git://github.com/openrazer/openrazer.git","ssh_url":"git@github.com:openrazer/openrazer.git","clone_url":"https://github.com/openrazer/openrazer.git","svn_url":"https://github.com/openrazer/openrazer","homepage":"https://openrazer.github.io/","size":9421,"stargazers_count":1244,"watchers_count":1244,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":197,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":125,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":197,"open_issues":125,"watchers":1244,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openrazer/openrazer/pulls/888"},"html":{"href":"https://github.com/openrazer/openrazer/pull/888"},"issue":{"href":"https://api.github.com/repos/openrazer/openrazer/issues/888"},"comments":{"href":"https://api.github.com/repos/openrazer/openrazer/issues/888/comments"},"review_comments":{"href":"https://api.github.com/repos/openrazer/openrazer/pulls/888/comments"},"review_comment":{"href":"https://api.github.com/repos/openrazer/openrazer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openrazer/openrazer/pulls/888/commits"},"statuses":{"href":"https://api.github.com/repos/openrazer/openrazer/statuses/1fb7f664c713c337116edadb081eab97d15f30e0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tildearrow"}}