{"action":"created","comment":{"url":"https://api.github.com/repos/breaker27/smarthomatic/pulls/comments/24716376","id":24716376,"diff_hunk":"@@ -456,7 +456,7 @@ sub SHCdev_Set($@)\n       # is able to do this as well. Even more it supports intervals, off-for-timer, off-till ...\n \n       if ($cmd eq 'toggle') {\n-        $cmd = ReadingsVal($name, \"state\", \"on\") eq \"off\" ? \"on\" : \"off\";\n+        $cmd = ReadingsVal($name, \"state\", \"on\") ~~ m/......0......./ ? \"on\" : \"off\";","path":"host_software/fhem/37_SHCdev.pm","position":5,"original_position":5,"commit_id":"9405128f723123d32b86c378dff8666dc3c8adcd","original_commit_id":"9405128f723123d32b86c378dff8666dc3c8adcd","user":{"login":"wurststulle","id":569706,"avatar_url":"https://avatars.githubusercontent.com/u/569706?v=3","gravatar_id":"","url":"https://api.github.com/users/wurststulle","html_url":"https://github.com/wurststulle","followers_url":"https://api.github.com/users/wurststulle/followers","following_url":"https://api.github.com/users/wurststulle/following{/other_user}","gists_url":"https://api.github.com/users/wurststulle/gists{/gist_id}","starred_url":"https://api.github.com/users/wurststulle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wurststulle/subscriptions","organizations_url":"https://api.github.com/users/wurststulle/orgs","repos_url":"https://api.github.com/users/wurststulle/repos","events_url":"https://api.github.com/users/wurststulle/events{/privacy}","received_events_url":"https://api.github.com/users/wurststulle/received_events","type":"User","site_admin":false},"body":"Its reading the state value. The regex gets the value of the first bit Form\nthe state value.\nAm 14.02.2015 19:29 schrieb \"breaker27\" <notifications@github.com>:\n\n> In host_software/fhem/37_SHCdev.pm\n> <https://github.com/breaker27/smarthomatic/pull/124#discussion_r24716225>:\n>\n> > @@ -456,7 +456,7 @@ sub SHCdev_Set($@)\n> >        # is able to do this as well. Even more it supports intervals, off-for-timer, off-till ...\n> >\n> >        if ($cmd eq 'toggle') {\n> > -        $cmd = ReadingsVal($name, \"state\", \"on\") eq \"off\" ? \"on\" : \"off\";\n> > +        $cmd = ReadingsVal($name, \"state\", \"on\") ~~ m/......0......./ ? \"on\" : \"off\";\n>\n> What does the regexp do (and how does FHEM react then)?\n>\n> I see that the previous definition is wrong, because the state does not\n> contain a string \"on\" and \"off\" any more.\n> Wouldn't it be better to write\n>\n> $cmd = ReadingsVal($name, \"on\", \"0\") eq \"0\" ? \"on\" : \"off\";\n>\n> (the \"on\" attribute in fhem represents the 1st switch, which I think\n> should be the one to toggle using the FHEM toggle function).\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/breaker27/smarthomatic/pull/124/files#r24716225>.\n>\n","created_at":"2015-02-14T18:50:22Z","updated_at":"2015-02-14T18:50:22Z","html_url":"https://github.com/breaker27/smarthomatic/pull/124#discussion_r24716376","pull_request_url":"https://api.github.com/repos/breaker27/smarthomatic/pulls/124","_links":{"self":{"href":"https://api.github.com/repos/breaker27/smarthomatic/pulls/comments/24716376"},"html":{"href":"https://github.com/breaker27/smarthomatic/pull/124#discussion_r24716376"},"pull_request":{"href":"https://api.github.com/repos/breaker27/smarthomatic/pulls/124"}}},"pull_request":{"url":"https://api.github.com/repos/breaker27/smarthomatic/pulls/124","id":29319964,"html_url":"https://github.com/breaker27/smarthomatic/pull/124","diff_url":"https://github.com/breaker27/smarthomatic/pull/124.diff","patch_url":"https://github.com/breaker27/smarthomatic/pull/124.patch","issue_url":"https://api.github.com/repos/breaker27/smarthomatic/issues/124","number":124,"state":"open","locked":false,"title":"fix fhem toggle web command for power switch","user":{"login":"wurststulle","id":569706,"avatar_url":"https://avatars.githubusercontent.com/u/569706?v=3","gravatar_id":"","url":"https://api.github.com/users/wurststulle","html_url":"https://github.com/wurststulle","followers_url":"https://api.github.com/users/wurststulle/followers","following_url":"https://api.github.com/users/wurststulle/following{/other_user}","gists_url":"https://api.github.com/users/wurststulle/gists{/gist_id}","starred_url":"https://api.github.com/users/wurststulle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wurststulle/subscriptions","organizations_url":"https://api.github.com/users/wurststulle/orgs","repos_url":"https://api.github.com/users/wurststulle/repos","events_url":"https://api.github.com/users/wurststulle/events{/privacy}","received_events_url":"https://api.github.com/users/wurststulle/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-14T13:08:19Z","updated_at":"2015-02-14T18:50:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13c710f6a697e90ba9082c953fb542b401568833","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/breaker27/smarthomatic/pulls/124/commits","review_comments_url":"https://api.github.com/repos/breaker27/smarthomatic/pulls/124/comments","review_comment_url":"https://api.github.com/repos/breaker27/smarthomatic/pulls/comments/{number}","comments_url":"https://api.github.com/repos/breaker27/smarthomatic/issues/124/comments","statuses_url":"https://api.github.com/repos/breaker27/smarthomatic/statuses/9405128f723123d32b86c378dff8666dc3c8adcd","head":{"label":"wurststulle:power_switch_toggle_fix","ref":"power_switch_toggle_fix","sha":"9405128f723123d32b86c378dff8666dc3c8adcd","user":{"login":"wurststulle","id":569706,"avatar_url":"https://avatars.githubusercontent.com/u/569706?v=3","gravatar_id":"","url":"https://api.github.com/users/wurststulle","html_url":"https://github.com/wurststulle","followers_url":"https://api.github.com/users/wurststulle/followers","following_url":"https://api.github.com/users/wurststulle/following{/other_user}","gists_url":"https://api.github.com/users/wurststulle/gists{/gist_id}","starred_url":"https://api.github.com/users/wurststulle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wurststulle/subscriptions","organizations_url":"https://api.github.com/users/wurststulle/orgs","repos_url":"https://api.github.com/users/wurststulle/repos","events_url":"https://api.github.com/users/wurststulle/events{/privacy}","received_events_url":"https://api.github.com/users/wurststulle/received_events","type":"User","site_admin":false},"repo":{"id":23241721,"name":"smarthomatic","full_name":"wurststulle/smarthomatic","owner":{"login":"wurststulle","id":569706,"avatar_url":"https://avatars.githubusercontent.com/u/569706?v=3","gravatar_id":"","url":"https://api.github.com/users/wurststulle","html_url":"https://github.com/wurststulle","followers_url":"https://api.github.com/users/wurststulle/followers","following_url":"https://api.github.com/users/wurststulle/following{/other_user}","gists_url":"https://api.github.com/users/wurststulle/gists{/gist_id}","starred_url":"https://api.github.com/users/wurststulle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wurststulle/subscriptions","organizations_url":"https://api.github.com/users/wurststulle/orgs","repos_url":"https://api.github.com/users/wurststulle/repos","events_url":"https://api.github.com/users/wurststulle/events{/privacy}","received_events_url":"https://api.github.com/users/wurststulle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wurststulle/smarthomatic","description":"smarthomatic","fork":true,"url":"https://api.github.com/repos/wurststulle/smarthomatic","forks_url":"https://api.github.com/repos/wurststulle/smarthomatic/forks","keys_url":"https://api.github.com/repos/wurststulle/smarthomatic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wurststulle/smarthomatic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wurststulle/smarthomatic/teams","hooks_url":"https://api.github.com/repos/wurststulle/smarthomatic/hooks","issue_events_url":"https://api.github.com/repos/wurststulle/smarthomatic/issues/events{/number}","events_url":"https://api.github.com/repos/wurststulle/smarthomatic/events","assignees_url":"https://api.github.com/repos/wurststulle/smarthomatic/assignees{/user}","branches_url":"https://api.github.com/repos/wurststulle/smarthomatic/branches{/branch}","tags_url":"https://api.github.com/repos/wurststulle/smarthomatic/tags","blobs_url":"https://api.github.com/repos/wurststulle/smarthomatic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wurststulle/smarthomatic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wurststulle/smarthomatic/git/refs{/sha}","trees_url":"https://api.github.com/repos/wurststulle/smarthomatic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wurststulle/smarthomatic/statuses/{sha}","languages_url":"https://api.github.com/repos/wurststulle/smarthomatic/languages","stargazers_url":"https://api.github.com/repos/wurststulle/smarthomatic/stargazers","contributors_url":"https://api.github.com/repos/wurststulle/smarthomatic/contributors","subscribers_url":"https://api.github.com/repos/wurststulle/smarthomatic/subscribers","subscription_url":"https://api.github.com/repos/wurststulle/smarthomatic/subscription","commits_url":"https://api.github.com/repos/wurststulle/smarthomatic/commits{/sha}","git_commits_url":"https://api.github.com/repos/wurststulle/smarthomatic/git/commits{/sha}","comments_url":"https://api.github.com/repos/wurststulle/smarthomatic/comments{/number}","issue_comment_url":"https://api.github.com/repos/wurststulle/smarthomatic/issues/comments/{number}","contents_url":"https://api.github.com/repos/wurststulle/smarthomatic/contents/{+path}","compare_url":"https://api.github.com/repos/wurststulle/smarthomatic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wurststulle/smarthomatic/merges","archive_url":"https://api.github.com/repos/wurststulle/smarthomatic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wurststulle/smarthomatic/downloads","issues_url":"https://api.github.com/repos/wurststulle/smarthomatic/issues{/number}","pulls_url":"https://api.github.com/repos/wurststulle/smarthomatic/pulls{/number}","milestones_url":"https://api.github.com/repos/wurststulle/smarthomatic/milestones{/number}","notifications_url":"https://api.github.com/repos/wurststulle/smarthomatic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wurststulle/smarthomatic/labels{/name}","releases_url":"https://api.github.com/repos/wurststulle/smarthomatic/releases{/id}","created_at":"2014-08-22T22:22:47Z","updated_at":"2014-09-27T18:50:37Z","pushed_at":"2015-02-14T13:07:06Z","git_url":"git://github.com/wurststulle/smarthomatic.git","ssh_url":"git@github.com:wurststulle/smarthomatic.git","clone_url":"https://github.com/wurststulle/smarthomatic.git","svn_url":"https://github.com/wurststulle/smarthomatic","homepage":"http://www.smarthomatic.org","size":3604,"stargazers_count":0,"watchers_count":0,"language":"C","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":"master"}},"base":{"label":"breaker27:develop","ref":"develop","sha":"04f58ee860460272c11ebfdc0c89448afc99d473","user":{"login":"breaker27","id":2500420,"avatar_url":"https://avatars.githubusercontent.com/u/2500420?v=3","gravatar_id":"","url":"https://api.github.com/users/breaker27","html_url":"https://github.com/breaker27","followers_url":"https://api.github.com/users/breaker27/followers","following_url":"https://api.github.com/users/breaker27/following{/other_user}","gists_url":"https://api.github.com/users/breaker27/gists{/gist_id}","starred_url":"https://api.github.com/users/breaker27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breaker27/subscriptions","organizations_url":"https://api.github.com/users/breaker27/orgs","repos_url":"https://api.github.com/users/breaker27/repos","events_url":"https://api.github.com/users/breaker27/events{/privacy}","received_events_url":"https://api.github.com/users/breaker27/received_events","type":"User","site_admin":false},"repo":{"id":12930129,"name":"smarthomatic","full_name":"breaker27/smarthomatic","owner":{"login":"breaker27","id":2500420,"avatar_url":"https://avatars.githubusercontent.com/u/2500420?v=3","gravatar_id":"","url":"https://api.github.com/users/breaker27","html_url":"https://github.com/breaker27","followers_url":"https://api.github.com/users/breaker27/followers","following_url":"https://api.github.com/users/breaker27/following{/other_user}","gists_url":"https://api.github.com/users/breaker27/gists{/gist_id}","starred_url":"https://api.github.com/users/breaker27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breaker27/subscriptions","organizations_url":"https://api.github.com/users/breaker27/orgs","repos_url":"https://api.github.com/users/breaker27/repos","events_url":"https://api.github.com/users/breaker27/events{/privacy}","received_events_url":"https://api.github.com/users/breaker27/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/breaker27/smarthomatic","description":"smarthomatic","fork":false,"url":"https://api.github.com/repos/breaker27/smarthomatic","forks_url":"https://api.github.com/repos/breaker27/smarthomatic/forks","keys_url":"https://api.github.com/repos/breaker27/smarthomatic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/breaker27/smarthomatic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/breaker27/smarthomatic/teams","hooks_url":"https://api.github.com/repos/breaker27/smarthomatic/hooks","issue_events_url":"https://api.github.com/repos/breaker27/smarthomatic/issues/events{/number}","events_url":"https://api.github.com/repos/breaker27/smarthomatic/events","assignees_url":"https://api.github.com/repos/breaker27/smarthomatic/assignees{/user}","branches_url":"https://api.github.com/repos/breaker27/smarthomatic/branches{/branch}","tags_url":"https://api.github.com/repos/breaker27/smarthomatic/tags","blobs_url":"https://api.github.com/repos/breaker27/smarthomatic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/breaker27/smarthomatic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/breaker27/smarthomatic/git/refs{/sha}","trees_url":"https://api.github.com/repos/breaker27/smarthomatic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/breaker27/smarthomatic/statuses/{sha}","languages_url":"https://api.github.com/repos/breaker27/smarthomatic/languages","stargazers_url":"https://api.github.com/repos/breaker27/smarthomatic/stargazers","contributors_url":"https://api.github.com/repos/breaker27/smarthomatic/contributors","subscribers_url":"https://api.github.com/repos/breaker27/smarthomatic/subscribers","subscription_url":"https://api.github.com/repos/breaker27/smarthomatic/subscription","commits_url":"https://api.github.com/repos/breaker27/smarthomatic/commits{/sha}","git_commits_url":"https://api.github.com/repos/breaker27/smarthomatic/git/commits{/sha}","comments_url":"https://api.github.com/repos/breaker27/smarthomatic/comments{/number}","issue_comment_url":"https://api.github.com/repos/breaker27/smarthomatic/issues/comments/{number}","contents_url":"https://api.github.com/repos/breaker27/smarthomatic/contents/{+path}","compare_url":"https://api.github.com/repos/breaker27/smarthomatic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/breaker27/smarthomatic/merges","archive_url":"https://api.github.com/repos/breaker27/smarthomatic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/breaker27/smarthomatic/downloads","issues_url":"https://api.github.com/repos/breaker27/smarthomatic/issues{/number}","pulls_url":"https://api.github.com/repos/breaker27/smarthomatic/pulls{/number}","milestones_url":"https://api.github.com/repos/breaker27/smarthomatic/milestones{/number}","notifications_url":"https://api.github.com/repos/breaker27/smarthomatic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/breaker27/smarthomatic/labels{/name}","releases_url":"https://api.github.com/repos/breaker27/smarthomatic/releases{/id}","created_at":"2013-09-18T17:51:12Z","updated_at":"2015-02-05T10:47:08Z","pushed_at":"2015-02-08T19:09:06Z","git_url":"git://github.com/breaker27/smarthomatic.git","ssh_url":"git@github.com:breaker27/smarthomatic.git","clone_url":"https://github.com/breaker27/smarthomatic.git","svn_url":"https://github.com/breaker27/smarthomatic","homepage":"http://www.smarthomatic.org","size":5853,"stargazers_count":15,"watchers_count":15,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":8,"forks":11,"open_issues":8,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/breaker27/smarthomatic/pulls/124"},"html":{"href":"https://github.com/breaker27/smarthomatic/pull/124"},"issue":{"href":"https://api.github.com/repos/breaker27/smarthomatic/issues/124"},"comments":{"href":"https://api.github.com/repos/breaker27/smarthomatic/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/breaker27/smarthomatic/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/breaker27/smarthomatic/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/breaker27/smarthomatic/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/breaker27/smarthomatic/statuses/9405128f723123d32b86c378dff8666dc3c8adcd"}}}}