{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/comments/171750428","pull_request_review_id":100659914,"id":171750428,"diff_hunk":"@@ -6,6 +6,7 @@\n using System.Threading.Tasks;","path":"Services/DeviceClient.cs","position":1,"original_position":1,"commit_id":"e6681811cd5a83a9b9a53c1d053b724e4df8a605","original_commit_id":"e6681811cd5a83a9b9a53c1d053b724e4df8a605","user":{"login":"dluc","id":371009,"avatar_url":"https://avatars2.githubusercontent.com/u/371009?v=4","gravatar_id":"","url":"https://api.github.com/users/dluc","html_url":"https://github.com/dluc","followers_url":"https://api.github.com/users/dluc/followers","following_url":"https://api.github.com/users/dluc/following{/other_user}","gists_url":"https://api.github.com/users/dluc/gists{/gist_id}","starred_url":"https://api.github.com/users/dluc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dluc/subscriptions","organizations_url":"https://api.github.com/users/dluc/orgs","repos_url":"https://api.github.com/users/dluc/repos","events_url":"https://api.github.com/users/dluc/events{/privacy}","received_events_url":"https://api.github.com/users/dluc/received_events","type":"User","site_admin":false},"body":"do you think I should wait for the final version before completing the CR?","created_at":"2018-03-02T02:14:13Z","updated_at":"2018-03-02T02:14:13Z","html_url":"https://github.com/Azure/device-simulation-dotnet/pull/173#discussion_r171750428","pull_request_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/173","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/comments/171750428"},"html":{"href":"https://github.com/Azure/device-simulation-dotnet/pull/173#discussion_r171750428"},"pull_request":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/173"}},"in_reply_to_id":171745640},"pull_request":{"url":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/173","id":172324260,"html_url":"https://github.com/Azure/device-simulation-dotnet/pull/173","diff_url":"https://github.com/Azure/device-simulation-dotnet/pull/173.diff","patch_url":"https://github.com/Azure/device-simulation-dotnet/pull/173.patch","issue_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues/173","number":173,"state":"open","locked":false,"title":"Add Device Properties logic to internal simulation","user":{"login":"jillcary","id":3317135,"avatar_url":"https://avatars1.githubusercontent.com/u/3317135?v=4","gravatar_id":"","url":"https://api.github.com/users/jillcary","html_url":"https://github.com/jillcary","followers_url":"https://api.github.com/users/jillcary/followers","following_url":"https://api.github.com/users/jillcary/following{/other_user}","gists_url":"https://api.github.com/users/jillcary/gists{/gist_id}","starred_url":"https://api.github.com/users/jillcary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jillcary/subscriptions","organizations_url":"https://api.github.com/users/jillcary/orgs","repos_url":"https://api.github.com/users/jillcary/repos","events_url":"https://api.github.com/users/jillcary/events{/privacy}","received_events_url":"https://api.github.com/users/jillcary/received_events","type":"User","site_admin":false},"body":"# Type of change? <!-- [x] all the boxes that apply -->\r\n\r\n- [ ] Bug fix\r\n- [x] New feature\r\n- [x] Enhancement\r\n- [ ] Breaking change (breaks backward compatibility)\r\n\r\n# Description, Context, Motivation <!-- Please help us reviewing your PR -->\r\n\r\n### Context:\r\nThis change adds back the functionality for the internal simulation to update the internal device properties state. This also adds some new classes for the SimulationAgent to manage device properties. \r\n\r\n### This change includes:\r\n1. Remove commented out code for Device Twin management.\r\n1. Addition of the **InternalDeviceState** Class\r\n    * The **\"InternalDeviceState\"** has been modified to encompass the following two entities:\r\n        1. The **\"DeviceSimulationState\"** refers to sensor data that is simulated by the DeviceStateActor (ex: temperature, humidity...)\r\n        1. The **\"DeviceProperties\"** refers to the values that are to be written to the IoT Hub Device Twin (ex: firmware, device type...)\r\n    * **Callbacks** -  This InternalDeviceState is then passed to the Javascript Interpreter so the scripts can update both the device state and the properties via a callback. \r\n    * **Change Notification** The InternalDeviceState also writes custom getters and setters so that modification of the properties sets a flag indicating the values have changed and should be updated on the IoT Hub. \r\n1. Pass the InternalDeviceState object instead of a ```Dictionary<string, object>``` to the ScriptInterpreter\r\n1. Add restore device property state logic to device scripts\r\n1. Add Stubbed DevicePropertyActor (functionality coming in future PR \r\n\r\n### Notes & Assumptions:\r\n* **Language and nomenclature** - \"Device Properties\" are used instead of \"Reported Properties\" or \"Device Twin\" for the internal device state. This is because this is the language that is to be used in the Device Model.\r\n* It is possible we could use a ```ConcurrentDictionary``` for the InternalDeviceState class as well\r\n\r\n### Out of scope for this PR (for future PR):\r\n- sending device properties to IoT Hub\r\n\r\n**Checklist:**\r\n\r\n- [x] All tests passed\r\n- [x] The code follows the code style and conventions of this project\r\n- [x] The change requires a change to the documentation\r\n- [ ] I have updated the documentation accordingly\r\n","created_at":"2018-03-01T19:01:24Z","updated_at":"2018-03-02T02:14:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ac7d4477e70c740c8b8fe00d5e12971b1cd61ff","assignee":null,"assignees":[],"requested_reviewers":[{"login":"timlaverty","id":5084013,"avatar_url":"https://avatars2.githubusercontent.com/u/5084013?v=4","gravatar_id":"","url":"https://api.github.com/users/timlaverty","html_url":"https://github.com/timlaverty","followers_url":"https://api.github.com/users/timlaverty/followers","following_url":"https://api.github.com/users/timlaverty/following{/other_user}","gists_url":"https://api.github.com/users/timlaverty/gists{/gist_id}","starred_url":"https://api.github.com/users/timlaverty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timlaverty/subscriptions","organizations_url":"https://api.github.com/users/timlaverty/orgs","repos_url":"https://api.github.com/users/timlaverty/repos","events_url":"https://api.github.com/users/timlaverty/events{/privacy}","received_events_url":"https://api.github.com/users/timlaverty/received_events","type":"User","site_admin":false},{"login":"ppathan","id":16170750,"avatar_url":"https://avatars2.githubusercontent.com/u/16170750?v=4","gravatar_id":"","url":"https://api.github.com/users/ppathan","html_url":"https://github.com/ppathan","followers_url":"https://api.github.com/users/ppathan/followers","following_url":"https://api.github.com/users/ppathan/following{/other_user}","gists_url":"https://api.github.com/users/ppathan/gists{/gist_id}","starred_url":"https://api.github.com/users/ppathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppathan/subscriptions","organizations_url":"https://api.github.com/users/ppathan/orgs","repos_url":"https://api.github.com/users/ppathan/repos","events_url":"https://api.github.com/users/ppathan/events{/privacy}","received_events_url":"https://api.github.com/users/ppathan/received_events","type":"User","site_admin":false},{"login":"avanikp","id":32693971,"avatar_url":"https://avatars1.githubusercontent.com/u/32693971?v=4","gravatar_id":"","url":"https://api.github.com/users/avanikp","html_url":"https://github.com/avanikp","followers_url":"https://api.github.com/users/avanikp/followers","following_url":"https://api.github.com/users/avanikp/following{/other_user}","gists_url":"https://api.github.com/users/avanikp/gists{/gist_id}","starred_url":"https://api.github.com/users/avanikp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avanikp/subscriptions","organizations_url":"https://api.github.com/users/avanikp/orgs","repos_url":"https://api.github.com/users/avanikp/repos","events_url":"https://api.github.com/users/avanikp/events{/privacy}","received_events_url":"https://api.github.com/users/avanikp/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/173/commits","review_comments_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/173/comments","review_comment_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues/173/comments","statuses_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/statuses/e6681811cd5a83a9b9a53c1d053b724e4df8a605","head":{"label":"Azure:device-twin-actor","ref":"device-twin-actor","sha":"e6681811cd5a83a9b9a53c1d053b724e4df8a605","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":89741887,"name":"device-simulation-dotnet","full_name":"Azure/device-simulation-dotnet","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/device-simulation-dotnet","description":"IoT Simulation service","fork":false,"url":"https://api.github.com/repos/Azure/device-simulation-dotnet","forks_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/forks","keys_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/teams","hooks_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/hooks","issue_events_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/events","assignees_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/tags","blobs_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/languages","stargazers_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/stargazers","contributors_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/contributors","subscribers_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/subscribers","subscription_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/subscription","commits_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/merges","archive_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/downloads","issues_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/deployments","created_at":"2017-04-28T20:20:08Z","updated_at":"2018-02-19T02:52:44Z","pushed_at":"2018-03-02T00:25:12Z","git_url":"git://github.com/Azure/device-simulation-dotnet.git","ssh_url":"git@github.com:Azure/device-simulation-dotnet.git","clone_url":"https://github.com/Azure/device-simulation-dotnet.git","svn_url":"https://github.com/Azure/device-simulation-dotnet","homepage":"","size":768,"stargazers_count":10,"watchers_count":10,"language":"C#","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":12,"open_issues":55,"watchers":10,"default_branch":"master"}},"base":{"label":"Azure:azure-iot-pcs-simulation","ref":"azure-iot-pcs-simulation","sha":"d7b1916d60d5eac20c373cafc472d2b600478499","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":89741887,"name":"device-simulation-dotnet","full_name":"Azure/device-simulation-dotnet","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/device-simulation-dotnet","description":"IoT Simulation service","fork":false,"url":"https://api.github.com/repos/Azure/device-simulation-dotnet","forks_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/forks","keys_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/teams","hooks_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/hooks","issue_events_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/events","assignees_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/tags","blobs_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/languages","stargazers_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/stargazers","contributors_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/contributors","subscribers_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/subscribers","subscription_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/subscription","commits_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/merges","archive_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/downloads","issues_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/device-simulation-dotnet/deployments","created_at":"2017-04-28T20:20:08Z","updated_at":"2018-02-19T02:52:44Z","pushed_at":"2018-03-02T00:25:12Z","git_url":"git://github.com/Azure/device-simulation-dotnet.git","ssh_url":"git@github.com:Azure/device-simulation-dotnet.git","clone_url":"https://github.com/Azure/device-simulation-dotnet.git","svn_url":"https://github.com/Azure/device-simulation-dotnet","homepage":"","size":768,"stargazers_count":10,"watchers_count":10,"language":"C#","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":55,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":12,"open_issues":55,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/173"},"html":{"href":"https://github.com/Azure/device-simulation-dotnet/pull/173"},"issue":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues/173"},"comments":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/device-simulation-dotnet/statuses/e6681811cd5a83a9b9a53c1d053b724e4df8a605"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dluc"}}