{"action":"created","comment":{"url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/comments/38144482","id":38144482,"diff_hunk":"@@ -15,20 +23,45 @@ public int getLevelInPercent() {\n         return 50; // actually unknown\n     }\n \n-    public String getStatus() {\n+    public BatteryState getState() {\n         if (mData.length >= 10) {\n             int value = mData[9];\n             switch (value) {\n-                case 1:\n-                    return GBApplication.getContext().getString(R.string.battery_low);\n-                case 2:\n-                    return GBApplication.getContext().getString(R.string.battery_medium);\n-                case 3:\n-                    return GBApplication.getContext().getString(R.string.battery_full);\n-                case 4:\n-                    return GBApplication.getContext().getString(R.string.battery_not_charging);\n+                case DEVICE_BATTERY_NORMAL:\n+                    return BatteryState.BATTERY_NORMAL;\n+                case DEVICE_BATTERY_LOW:\n+                    return BatteryState.BATTERY_LOW;\n+                case DEVICE_BATTERY_CHARGING:\n+                    return BatteryState.BATTERY_CHARGING;\n+                case DEVICE_BATTERY_CHARGING_FULL:\n+                    return BatteryState.BATTERY_CHARGING_FULL;\n+                case DEVICE_BATTERY_CHARGE_OFF:\n+                    return BatteryState.BATTERY_NOT_CHARGING_FULL;\n             }\n         }\n-        return GBApplication.getContext().getString(R.string._unknown_);\n+        return BatteryState.UNKNOWN;\n+    }\n+\n+    public GregorianCalendar getLastChargeTime() {","path":"app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/BatteryInfo.java","position":53,"original_position":53,"commit_id":"3a6e433fb370cb5c01e9c93900b4294b12505081","original_commit_id":"3356a4b066b51867a49ba61ead0df177bbc31b9b","user":{"login":"cpfeiffer","id":1457896,"avatar_url":"https://avatars.githubusercontent.com/u/1457896?v=3","gravatar_id":"","url":"https://api.github.com/users/cpfeiffer","html_url":"https://github.com/cpfeiffer","followers_url":"https://api.github.com/users/cpfeiffer/followers","following_url":"https://api.github.com/users/cpfeiffer/following{/other_user}","gists_url":"https://api.github.com/users/cpfeiffer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpfeiffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpfeiffer/subscriptions","organizations_url":"https://api.github.com/users/cpfeiffer/orgs","repos_url":"https://api.github.com/users/cpfeiffer/repos","events_url":"https://api.github.com/users/cpfeiffer/events{/privacy}","received_events_url":"https://api.github.com/users/cpfeiffer/received_events","type":"User","site_admin":false},"body":"I guess I should enhance the documentation of the *Coordinator classes some more. Maybe they should even be renamed to something like MiBandUISupport or something like that. The coordinator classes are meant to be used in the UI part only, not by the service. And they are meant to be used generically through the DeviceCoordinator interface.\r\n\r\nThat's why I suggested to put this into the MiBandConst class. If this is poorly named, maybe we should find a better place for it as well.","created_at":"2015-08-27T20:50:41Z","updated_at":"2015-08-27T20:50:41Z","html_url":"https://github.com/Freeyourgadget/Gadgetbridge/pull/101#discussion_r38144482","pull_request_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/comments/38144482"},"html":{"href":"https://github.com/Freeyourgadget/Gadgetbridge/pull/101#discussion_r38144482"},"pull_request":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/101","id":43417194,"html_url":"https://github.com/Freeyourgadget/Gadgetbridge/pull/101","diff_url":"https://github.com/Freeyourgadget/Gadgetbridge/pull/101.diff","patch_url":"https://github.com/Freeyourgadget/Gadgetbridge/pull/101.patch","issue_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues/101","number":101,"state":"open","locked":false,"title":"Low battery notification","user":{"login":"danielegobbetti","id":352756,"avatar_url":"https://avatars.githubusercontent.com/u/352756?v=3","gravatar_id":"","url":"https://api.github.com/users/danielegobbetti","html_url":"https://github.com/danielegobbetti","followers_url":"https://api.github.com/users/danielegobbetti/followers","following_url":"https://api.github.com/users/danielegobbetti/following{/other_user}","gists_url":"https://api.github.com/users/danielegobbetti/gists{/gist_id}","starred_url":"https://api.github.com/users/danielegobbetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielegobbetti/subscriptions","organizations_url":"https://api.github.com/users/danielegobbetti/orgs","repos_url":"https://api.github.com/users/danielegobbetti/repos","events_url":"https://api.github.com/users/danielegobbetti/events{/privacy}","received_events_url":"https://api.github.com/users/danielegobbetti/received_events","type":"User","site_admin":false},"body":"Implements notification to the user when the device battery reaches a defined threshold.\r\nCloses #71","created_at":"2015-08-26T15:40:02Z","updated_at":"2015-08-27T20:50:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1715d1ca2acadb254270c31567dcb4200801428e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/101/commits","review_comments_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/101/comments","review_comment_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues/101/comments","statuses_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/statuses/3a6e433fb370cb5c01e9c93900b4294b12505081","head":{"label":"Freeyourgadget:low_battery_notification","ref":"low_battery_notification","sha":"3a6e433fb370cb5c01e9c93900b4294b12505081","user":{"login":"Freeyourgadget","id":10392806,"avatar_url":"https://avatars.githubusercontent.com/u/10392806?v=3","gravatar_id":"","url":"https://api.github.com/users/Freeyourgadget","html_url":"https://github.com/Freeyourgadget","followers_url":"https://api.github.com/users/Freeyourgadget/followers","following_url":"https://api.github.com/users/Freeyourgadget/following{/other_user}","gists_url":"https://api.github.com/users/Freeyourgadget/gists{/gist_id}","starred_url":"https://api.github.com/users/Freeyourgadget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Freeyourgadget/subscriptions","organizations_url":"https://api.github.com/users/Freeyourgadget/orgs","repos_url":"https://api.github.com/users/Freeyourgadget/repos","events_url":"https://api.github.com/users/Freeyourgadget/events{/privacy}","received_events_url":"https://api.github.com/users/Freeyourgadget/received_events","type":"Organization","site_admin":false},"repo":{"id":28836678,"name":"Gadgetbridge","full_name":"Freeyourgadget/Gadgetbridge","owner":{"login":"Freeyourgadget","id":10392806,"avatar_url":"https://avatars.githubusercontent.com/u/10392806?v=3","gravatar_id":"","url":"https://api.github.com/users/Freeyourgadget","html_url":"https://github.com/Freeyourgadget","followers_url":"https://api.github.com/users/Freeyourgadget/followers","following_url":"https://api.github.com/users/Freeyourgadget/following{/other_user}","gists_url":"https://api.github.com/users/Freeyourgadget/gists{/gist_id}","starred_url":"https://api.github.com/users/Freeyourgadget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Freeyourgadget/subscriptions","organizations_url":"https://api.github.com/users/Freeyourgadget/orgs","repos_url":"https://api.github.com/users/Freeyourgadget/repos","events_url":"https://api.github.com/users/Freeyourgadget/events{/privacy}","received_events_url":"https://api.github.com/users/Freeyourgadget/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Freeyourgadget/Gadgetbridge","description":"","fork":false,"url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge","forks_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/forks","keys_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/teams","hooks_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/hooks","issue_events_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues/events{/number}","events_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/events","assignees_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/assignees{/user}","branches_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/branches{/branch}","tags_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/tags","blobs_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/refs{/sha}","trees_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/statuses/{sha}","languages_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/languages","stargazers_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/stargazers","contributors_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/contributors","subscribers_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/subscribers","subscription_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/subscription","commits_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/commits{/sha}","git_commits_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/commits{/sha}","comments_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/comments{/number}","issue_comment_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues/comments{/number}","contents_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/contents/{+path}","compare_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/merges","archive_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/downloads","issues_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues{/number}","pulls_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls{/number}","milestones_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/milestones{/number}","notifications_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/labels{/name}","releases_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/releases{/id}","created_at":"2015-01-05T23:19:03Z","updated_at":"2015-08-27T01:45:08Z","pushed_at":"2015-08-27T16:03:09Z","git_url":"git://github.com/Freeyourgadget/Gadgetbridge.git","ssh_url":"git@github.com:Freeyourgadget/Gadgetbridge.git","clone_url":"https://github.com/Freeyourgadget/Gadgetbridge.git","svn_url":"https://github.com/Freeyourgadget/Gadgetbridge","homepage":null,"size":3123,"stargazers_count":79,"watchers_count":79,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":30,"forks":9,"open_issues":30,"watchers":79,"default_branch":"master"}},"base":{"label":"Freeyourgadget:master","ref":"master","sha":"027e6fe8c3f753e04ca3a148e716422797b7d9d6","user":{"login":"Freeyourgadget","id":10392806,"avatar_url":"https://avatars.githubusercontent.com/u/10392806?v=3","gravatar_id":"","url":"https://api.github.com/users/Freeyourgadget","html_url":"https://github.com/Freeyourgadget","followers_url":"https://api.github.com/users/Freeyourgadget/followers","following_url":"https://api.github.com/users/Freeyourgadget/following{/other_user}","gists_url":"https://api.github.com/users/Freeyourgadget/gists{/gist_id}","starred_url":"https://api.github.com/users/Freeyourgadget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Freeyourgadget/subscriptions","organizations_url":"https://api.github.com/users/Freeyourgadget/orgs","repos_url":"https://api.github.com/users/Freeyourgadget/repos","events_url":"https://api.github.com/users/Freeyourgadget/events{/privacy}","received_events_url":"https://api.github.com/users/Freeyourgadget/received_events","type":"Organization","site_admin":false},"repo":{"id":28836678,"name":"Gadgetbridge","full_name":"Freeyourgadget/Gadgetbridge","owner":{"login":"Freeyourgadget","id":10392806,"avatar_url":"https://avatars.githubusercontent.com/u/10392806?v=3","gravatar_id":"","url":"https://api.github.com/users/Freeyourgadget","html_url":"https://github.com/Freeyourgadget","followers_url":"https://api.github.com/users/Freeyourgadget/followers","following_url":"https://api.github.com/users/Freeyourgadget/following{/other_user}","gists_url":"https://api.github.com/users/Freeyourgadget/gists{/gist_id}","starred_url":"https://api.github.com/users/Freeyourgadget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Freeyourgadget/subscriptions","organizations_url":"https://api.github.com/users/Freeyourgadget/orgs","repos_url":"https://api.github.com/users/Freeyourgadget/repos","events_url":"https://api.github.com/users/Freeyourgadget/events{/privacy}","received_events_url":"https://api.github.com/users/Freeyourgadget/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Freeyourgadget/Gadgetbridge","description":"","fork":false,"url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge","forks_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/forks","keys_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/teams","hooks_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/hooks","issue_events_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues/events{/number}","events_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/events","assignees_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/assignees{/user}","branches_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/branches{/branch}","tags_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/tags","blobs_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/refs{/sha}","trees_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/statuses/{sha}","languages_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/languages","stargazers_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/stargazers","contributors_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/contributors","subscribers_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/subscribers","subscription_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/subscription","commits_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/commits{/sha}","git_commits_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/git/commits{/sha}","comments_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/comments{/number}","issue_comment_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues/comments{/number}","contents_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/contents/{+path}","compare_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/merges","archive_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/downloads","issues_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues{/number}","pulls_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls{/number}","milestones_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/milestones{/number}","notifications_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/labels{/name}","releases_url":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/releases{/id}","created_at":"2015-01-05T23:19:03Z","updated_at":"2015-08-27T01:45:08Z","pushed_at":"2015-08-27T16:03:09Z","git_url":"git://github.com/Freeyourgadget/Gadgetbridge.git","ssh_url":"git@github.com:Freeyourgadget/Gadgetbridge.git","clone_url":"https://github.com/Freeyourgadget/Gadgetbridge.git","svn_url":"https://github.com/Freeyourgadget/Gadgetbridge","homepage":null,"size":3123,"stargazers_count":79,"watchers_count":79,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":30,"forks":9,"open_issues":30,"watchers":79,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/101"},"html":{"href":"https://github.com/Freeyourgadget/Gadgetbridge/pull/101"},"issue":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues/101"},"comments":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/Freeyourgadget/Gadgetbridge/statuses/3a6e433fb370cb5c01e9c93900b4294b12505081"}}}}