{"action":"created","comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/60677434","id":60677434,"diff_hunk":"@@ -192,6 +192,10 @@ def turn_on(self, **kwargs):\n         \"\"\"Turn the device on.\"\"\"\n         should_update = False\n \n+        if not self._state:\n+            mqtt.publish(self._hass, self._topic[\"command_topic\"],\n+            self._payload[\"on\"], self._qos, self._retain)\n+            ","path":"homeassistant/components/light/mqtt.py","position":7,"original_position":7,"commit_id":"c670d79175b7fe1d0e3569d41f7e3285469aa60d","original_commit_id":"c670d79175b7fe1d0e3569d41f7e3285469aa60d","user":{"login":"balloobbot","id":16367972,"avatar_url":"https://avatars.githubusercontent.com/u/16367972?v=3","gravatar_id":"","url":"https://api.github.com/users/balloobbot","html_url":"https://github.com/balloobbot","followers_url":"https://api.github.com/users/balloobbot/followers","following_url":"https://api.github.com/users/balloobbot/following{/other_user}","gists_url":"https://api.github.com/users/balloobbot/gists{/gist_id}","starred_url":"https://api.github.com/users/balloobbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balloobbot/subscriptions","organizations_url":"https://api.github.com/users/balloobbot/orgs","repos_url":"https://api.github.com/users/balloobbot/repos","events_url":"https://api.github.com/users/balloobbot/events{/privacy}","received_events_url":"https://api.github.com/users/balloobbot/received_events","type":"User","site_admin":false},"body":"_[farcy v1.1](https://github.com/appfolio/farcy)_\n* 1: W293 blank line contains whitespace","created_at":"2016-04-22T00:48:50Z","updated_at":"2016-04-22T00:48:50Z","html_url":"https://github.com/home-assistant/home-assistant/pull/1883#discussion_r60677434","pull_request_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1883","_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments/60677434"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/1883#discussion_r60677434"},"pull_request":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1883"}}},"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1883","id":67444234,"html_url":"https://github.com/home-assistant/home-assistant/pull/1883","diff_url":"https://github.com/home-assistant/home-assistant/pull/1883.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/1883.patch","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/1883","number":1883,"state":"open","locked":false,"title":"Update mqtt.py","user":{"login":"rotopeon","id":18532374,"avatar_url":"https://avatars.githubusercontent.com/u/18532374?v=3","gravatar_id":"","url":"https://api.github.com/users/rotopeon","html_url":"https://github.com/rotopeon","followers_url":"https://api.github.com/users/rotopeon/followers","following_url":"https://api.github.com/users/rotopeon/following{/other_user}","gists_url":"https://api.github.com/users/rotopeon/gists{/gist_id}","starred_url":"https://api.github.com/users/rotopeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rotopeon/subscriptions","organizations_url":"https://api.github.com/users/rotopeon/orgs","repos_url":"https://api.github.com/users/rotopeon/repos","events_url":"https://api.github.com/users/rotopeon/events{/privacy}","received_events_url":"https://api.github.com/users/rotopeon/received_events","type":"User","site_admin":false},"body":"**Description:**\r\nAdded a check to prevent sending payload on when light is already on\r\nThis is helpful when using ESP8266 with espeasy firmware as you are just sending pwm value via mqtt directly to IO pin. It was conflicting with a change of brightness.\r\nMy command topic is the same as the brightness topic. When there was a brightness change, HA was always sending a ''payload on'' AFTER the brightness value.\r\nI'm still having issue with tracking the brightness value after on off but this is a start\r\n\r\n**Related issue (if applicable):** #\r\n\r\n**Example entry for `configuration.yaml` (if applicable):**\r\n```yaml\r\n\r\n```\r\n\r\n**Checklist:**\r\n\r\nIf code communicates with devices:\r\n  - [ ] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**\r\n  - [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).\r\n  - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).\r\n  - [ ] New dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.\r\n  - [ ] New files were added to `.coveragerc`.\r\n\r\nIf the code does not interact with devices:\r\n  - [ ] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**\r\n  - [ ] Tests have been added to verify that the new code works.\r\n\r\n[fork]: http://stackoverflow.com/a/7244456\r\n[squash]: https://github.com/ginatrapani/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit\r\n[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L16\r\n[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L51\r\n","created_at":"2016-04-22T00:48:02Z","updated_at":"2016-04-22T00:48:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74dc89373477a33621daba01fef04c0ab1c69d15","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1883/commits","review_comments_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1883/comments","review_comment_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/1883/comments","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/c670d79175b7fe1d0e3569d41f7e3285469aa60d","head":{"label":"rotopeon:patch-1","ref":"patch-1","sha":"c670d79175b7fe1d0e3569d41f7e3285469aa60d","user":{"login":"rotopeon","id":18532374,"avatar_url":"https://avatars.githubusercontent.com/u/18532374?v=3","gravatar_id":"","url":"https://api.github.com/users/rotopeon","html_url":"https://github.com/rotopeon","followers_url":"https://api.github.com/users/rotopeon/followers","following_url":"https://api.github.com/users/rotopeon/following{/other_user}","gists_url":"https://api.github.com/users/rotopeon/gists{/gist_id}","starred_url":"https://api.github.com/users/rotopeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rotopeon/subscriptions","organizations_url":"https://api.github.com/users/rotopeon/orgs","repos_url":"https://api.github.com/users/rotopeon/repos","events_url":"https://api.github.com/users/rotopeon/events{/privacy}","received_events_url":"https://api.github.com/users/rotopeon/received_events","type":"User","site_admin":false},"repo":{"id":56814130,"name":"home-assistant","full_name":"rotopeon/home-assistant","owner":{"login":"rotopeon","id":18532374,"avatar_url":"https://avatars.githubusercontent.com/u/18532374?v=3","gravatar_id":"","url":"https://api.github.com/users/rotopeon","html_url":"https://github.com/rotopeon","followers_url":"https://api.github.com/users/rotopeon/followers","following_url":"https://api.github.com/users/rotopeon/following{/other_user}","gists_url":"https://api.github.com/users/rotopeon/gists{/gist_id}","starred_url":"https://api.github.com/users/rotopeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rotopeon/subscriptions","organizations_url":"https://api.github.com/users/rotopeon/orgs","repos_url":"https://api.github.com/users/rotopeon/repos","events_url":"https://api.github.com/users/rotopeon/events{/privacy}","received_events_url":"https://api.github.com/users/rotopeon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rotopeon/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":true,"url":"https://api.github.com/repos/rotopeon/home-assistant","forks_url":"https://api.github.com/repos/rotopeon/home-assistant/forks","keys_url":"https://api.github.com/repos/rotopeon/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rotopeon/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rotopeon/home-assistant/teams","hooks_url":"https://api.github.com/repos/rotopeon/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/rotopeon/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/rotopeon/home-assistant/events","assignees_url":"https://api.github.com/repos/rotopeon/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/rotopeon/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/rotopeon/home-assistant/tags","blobs_url":"https://api.github.com/repos/rotopeon/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rotopeon/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rotopeon/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/rotopeon/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rotopeon/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/rotopeon/home-assistant/languages","stargazers_url":"https://api.github.com/repos/rotopeon/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/rotopeon/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/rotopeon/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/rotopeon/home-assistant/subscription","commits_url":"https://api.github.com/repos/rotopeon/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/rotopeon/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/rotopeon/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/rotopeon/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/rotopeon/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/rotopeon/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rotopeon/home-assistant/merges","archive_url":"https://api.github.com/repos/rotopeon/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rotopeon/home-assistant/downloads","issues_url":"https://api.github.com/repos/rotopeon/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/rotopeon/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/rotopeon/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/rotopeon/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rotopeon/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/rotopeon/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/rotopeon/home-assistant/deployments","created_at":"2016-04-22T00:32:52Z","updated_at":"2016-04-22T00:32:54Z","pushed_at":"2016-04-22T00:44:27Z","git_url":"git://github.com/rotopeon/home-assistant.git","ssh_url":"git@github.com:rotopeon/home-assistant.git","clone_url":"https://github.com/rotopeon/home-assistant.git","svn_url":"https://github.com/rotopeon/home-assistant","homepage":"https://home-assistant.io","size":57154,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"home-assistant:master","ref":"master","sha":"1d3c6da6c82c06bea25ddc09e7911e6e2e7a0296","user":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars.githubusercontent.com/u/13844975?v=3","gravatar_id":"","url":"https://api.github.com/users/home-assistant","html_url":"https://github.com/home-assistant","followers_url":"https://api.github.com/users/home-assistant/followers","following_url":"https://api.github.com/users/home-assistant/following{/other_user}","gists_url":"https://api.github.com/users/home-assistant/gists{/gist_id}","starred_url":"https://api.github.com/users/home-assistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/home-assistant/subscriptions","organizations_url":"https://api.github.com/users/home-assistant/orgs","repos_url":"https://api.github.com/users/home-assistant/repos","events_url":"https://api.github.com/users/home-assistant/events{/privacy}","received_events_url":"https://api.github.com/users/home-assistant/received_events","type":"Organization","site_admin":false},"repo":{"id":12888993,"name":"home-assistant","full_name":"home-assistant/home-assistant","owner":{"login":"home-assistant","id":13844975,"avatar_url":"https://avatars.githubusercontent.com/u/13844975?v=3","gravatar_id":"","url":"https://api.github.com/users/home-assistant","html_url":"https://github.com/home-assistant","followers_url":"https://api.github.com/users/home-assistant/followers","following_url":"https://api.github.com/users/home-assistant/following{/other_user}","gists_url":"https://api.github.com/users/home-assistant/gists{/gist_id}","starred_url":"https://api.github.com/users/home-assistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/home-assistant/subscriptions","organizations_url":"https://api.github.com/users/home-assistant/orgs","repos_url":"https://api.github.com/users/home-assistant/repos","events_url":"https://api.github.com/users/home-assistant/events{/privacy}","received_events_url":"https://api.github.com/users/home-assistant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/home-assistant/home-assistant","description":":house_with_garden: Open-source home automation platform running on Python 3","fork":false,"url":"https://api.github.com/repos/home-assistant/home-assistant","forks_url":"https://api.github.com/repos/home-assistant/home-assistant/forks","keys_url":"https://api.github.com/repos/home-assistant/home-assistant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/home-assistant/home-assistant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/home-assistant/home-assistant/teams","hooks_url":"https://api.github.com/repos/home-assistant/home-assistant/hooks","issue_events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/events{/number}","events_url":"https://api.github.com/repos/home-assistant/home-assistant/events","assignees_url":"https://api.github.com/repos/home-assistant/home-assistant/assignees{/user}","branches_url":"https://api.github.com/repos/home-assistant/home-assistant/branches{/branch}","tags_url":"https://api.github.com/repos/home-assistant/home-assistant/tags","blobs_url":"https://api.github.com/repos/home-assistant/home-assistant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/home-assistant/home-assistant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/home-assistant/home-assistant/git/refs{/sha}","trees_url":"https://api.github.com/repos/home-assistant/home-assistant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/home-assistant/home-assistant/statuses/{sha}","languages_url":"https://api.github.com/repos/home-assistant/home-assistant/languages","stargazers_url":"https://api.github.com/repos/home-assistant/home-assistant/stargazers","contributors_url":"https://api.github.com/repos/home-assistant/home-assistant/contributors","subscribers_url":"https://api.github.com/repos/home-assistant/home-assistant/subscribers","subscription_url":"https://api.github.com/repos/home-assistant/home-assistant/subscription","commits_url":"https://api.github.com/repos/home-assistant/home-assistant/commits{/sha}","git_commits_url":"https://api.github.com/repos/home-assistant/home-assistant/git/commits{/sha}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/comments{/number}","issue_comment_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/comments{/number}","contents_url":"https://api.github.com/repos/home-assistant/home-assistant/contents/{+path}","compare_url":"https://api.github.com/repos/home-assistant/home-assistant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/home-assistant/home-assistant/merges","archive_url":"https://api.github.com/repos/home-assistant/home-assistant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/home-assistant/home-assistant/downloads","issues_url":"https://api.github.com/repos/home-assistant/home-assistant/issues{/number}","pulls_url":"https://api.github.com/repos/home-assistant/home-assistant/pulls{/number}","milestones_url":"https://api.github.com/repos/home-assistant/home-assistant/milestones{/number}","notifications_url":"https://api.github.com/repos/home-assistant/home-assistant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/labels{/name}","releases_url":"https://api.github.com/repos/home-assistant/home-assistant/releases{/id}","deployments_url":"https://api.github.com/repos/home-assistant/home-assistant/deployments","created_at":"2013-09-17T07:29:48Z","updated_at":"2016-04-21T19:05:40Z","pushed_at":"2016-04-22T00:48:03Z","git_url":"git://github.com/home-assistant/home-assistant.git","ssh_url":"git@github.com:home-assistant/home-assistant.git","clone_url":"https://github.com/home-assistant/home-assistant.git","svn_url":"https://github.com/home-assistant/home-assistant","homepage":"https://home-assistant.io","size":58625,"stargazers_count":3212,"watchers_count":3212,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":608,"mirror_url":null,"open_issues_count":143,"forks":608,"open_issues":143,"watchers":3212,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1883"},"html":{"href":"https://github.com/home-assistant/home-assistant/pull/1883"},"issue":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/1883"},"comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/issues/1883/comments"},"review_comments":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1883/comments"},"review_comment":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/home-assistant/home-assistant/pulls/1883/commits"},"statuses":{"href":"https://api.github.com/repos/home-assistant/home-assistant/statuses/c670d79175b7fe1d0e3569d41f7e3285469aa60d"}}}}