{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/smarthome/issues/2022","repository_url":"https://api.github.com/repos/eclipse/smarthome","labels_url":"https://api.github.com/repos/eclipse/smarthome/issues/2022/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/smarthome/issues/2022/comments","events_url":"https://api.github.com/repos/eclipse/smarthome/issues/2022/events","html_url":"https://github.com/eclipse/smarthome/pull/2022","id":172272365,"number":2022,"title":"add the isInitialized function to the thing itself","user":{"login":"maggu2810","id":204670,"avatar_url":"https://avatars.githubusercontent.com/u/204670?v=3","gravatar_id":"","url":"https://api.github.com/users/maggu2810","html_url":"https://github.com/maggu2810","followers_url":"https://api.github.com/users/maggu2810/followers","following_url":"https://api.github.com/users/maggu2810/following{/other_user}","gists_url":"https://api.github.com/users/maggu2810/gists{/gist_id}","starred_url":"https://api.github.com/users/maggu2810/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maggu2810/subscriptions","organizations_url":"https://api.github.com/users/maggu2810/orgs","repos_url":"https://api.github.com/users/maggu2810/repos","events_url":"https://api.github.com/users/maggu2810/events{/privacy}","received_events_url":"https://api.github.com/users/maggu2810/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-20T13:58:37Z","updated_at":"2016-08-22T08:52:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eclipse/smarthome/pulls/2022","html_url":"https://github.com/eclipse/smarthome/pull/2022","diff_url":"https://github.com/eclipse/smarthome/pull/2022.diff","patch_url":"https://github.com/eclipse/smarthome/pull/2022.patch"},"body":"The BaseThingHandler, the ThingManager and the ThingLinkManager contains a method to check if a thing has been initialized.\r\nI moved that logic to a function of the thing itself, so there is only one implementation.\r\n\r\nI didn't remove the old (protected) method of the BaseThingHandler but marked it deprecated. So bindings using this method have some time to change their implementation."},"comment":{"url":"https://api.github.com/repos/eclipse/smarthome/issues/comments/241351175","html_url":"https://github.com/eclipse/smarthome/pull/2022#issuecomment-241351175","issue_url":"https://api.github.com/repos/eclipse/smarthome/issues/2022","id":241351175,"user":{"login":"maggu2810","id":204670,"avatar_url":"https://avatars.githubusercontent.com/u/204670?v=3","gravatar_id":"","url":"https://api.github.com/users/maggu2810","html_url":"https://github.com/maggu2810","followers_url":"https://api.github.com/users/maggu2810/followers","following_url":"https://api.github.com/users/maggu2810/following{/other_user}","gists_url":"https://api.github.com/users/maggu2810/gists{/gist_id}","starred_url":"https://api.github.com/users/maggu2810/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maggu2810/subscriptions","organizations_url":"https://api.github.com/users/maggu2810/orgs","repos_url":"https://api.github.com/users/maggu2810/repos","events_url":"https://api.github.com/users/maggu2810/events{/privacy}","received_events_url":"https://api.github.com/users/maggu2810/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T08:52:11Z","updated_at":"2016-08-22T08:52:11Z","body":"@sjka That is comprehensible for me. The handler is initialized and not the thing.\r\n\r\nCurrently that information depends on the thing status.\r\nBut is the `Thing` the correct location then at all?\r\nThe thing itself does not know if a handler is assigned and initialized.\r\n\r\nIf the thing link manager, the thing manager and the base thing handler itself needs to now if the handler is initialized but this information depends on the thing status, should we create a static method in some class (not the thing class)?\r\nThat function could derive the thing handler inizialized state from the thing status at the moment.\r\nThere is only one place that implements the logic.\r\nThe usage of that function could be found easily etc.\r\n\r\n```java\r\npublic static final boolean isHandlerInitialized(final Thing thing) {\r\n    final ThingStatus thing.thingStatus = getStatus();\r\n    return thingStatus == ThingStatus.OFFLINE || thingStatus == ThingStatus.ONLINE;\r\n}\r\n```\r\n\r\nWDYT? Which class should contain that function, e.g. a ThingHandlerUtils one?"}}
{"actor":{"display_login":"maggu2810"}}