{"action":"created","issue":{"url":"https://api.github.com/repos/zigpy/zigpy/issues/110","repository_url":"https://api.github.com/repos/zigpy/zigpy","labels_url":"https://api.github.com/repos/zigpy/zigpy/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/zigpy/zigpy/issues/110/comments","events_url":"https://api.github.com/repos/zigpy/zigpy/issues/110/events","html_url":"https://github.com/zigpy/zigpy/pull/110","id":395447778,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxODk4Njkz","number":110,"title":"Pop device from registry after ZDO leave request.","user":{"login":"Adminiuga","id":5826160,"node_id":"MDQ6VXNlcjU4MjYxNjA=","avatar_url":"https://avatars1.githubusercontent.com/u/5826160?v=4","gravatar_id":"","url":"https://api.github.com/users/Adminiuga","html_url":"https://github.com/Adminiuga","followers_url":"https://api.github.com/users/Adminiuga/followers","following_url":"https://api.github.com/users/Adminiuga/following{/other_user}","gists_url":"https://api.github.com/users/Adminiuga/gists{/gist_id}","starred_url":"https://api.github.com/users/Adminiuga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Adminiuga/subscriptions","organizations_url":"https://api.github.com/users/Adminiuga/orgs","repos_url":"https://api.github.com/users/Adminiuga/repos","events_url":"https://api.github.com/users/Adminiuga/events{/privacy}","received_events_url":"https://api.github.com/users/Adminiuga/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-03T03:31:34Z","updated_at":"2019-01-03T03:33:25Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/zigpy/zigpy/pulls/110","html_url":"https://github.com/zigpy/zigpy/pull/110","diff_url":"https://github.com/zigpy/zigpy/pull/110.diff","patch_url":"https://github.com/zigpy/zigpy/pull/110.patch"},"body":"When removing a device, pop it from device registry after issuing ZDO leave request.\r\n\r\nCurrently we're poping the device too soon, so we never get a proper reply to \"ZDO leave req\" since device is gone and deserialization is not happening. \r\nHere's a log, for a few devices being issued a `ZDO leave` request, however when we get an `incomingMessageHandler` with a reply to leave request, we fail to process it, because it comes from an unknown device\r\n```\r\n2019-01-02 17:57:51 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=remove, service_data=ieee_address=f0:d1:b8:00:00:05:13:93, domain=zha>\r\n2019-01-02 17:57:51 INFO (MainThread) [homeassistant.components.zha] Removing node f0:d1:b8:00:00:05:13:93\r\n2019-01-02 17:57:51 INFO (MainThread) [zigpy.application] Removing device 0x40e6 (f0:d1:b8:00:00:05:13:93)\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.ezsp] Send command sendUnicast\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Sending: b'61542157541e155419944a7d31aa5592099d4e27aaecc4667d38eec3638944afcfa5168a7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Data frame: b'1754a157541e15ee31637e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Sending: b'82503a7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.ezsp] Application frame 52 (sendUnicast) received\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Data frame: b'2754b157546f15b259a0ca25aa1593499c80d8660b8e9874ffc763d7017e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Sending: b'83401b7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.ezsp] Application frame 69 (incomingMessageHandler) received\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.zigbee.application] No such device 16614\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Data frame: b'3754b157540ef3f2ca874f25aaed43b99e4dd854100e7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Sending: b'8430fc7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.ezsp] Application frame 36 (trustCenterJoinHandler) received\r\n2019-01-02 17:57:51 INFO (MainThread) [zigpy.application] Device 0x40e6 (f0:d1:b8:00:00:05:13:93) left the network\r\n```\r\nSame device after it was rejoined\r\n```\r\n2019-01-02 17:57:51 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=remove, service_data=ieee_address=f0:d1:b8:00:00:05:13:93, domain=zha>\r\n2019-01-02 17:57:51 INFO (MainThread) [homeassistant.components.zha] Removing node f0:d1:b8:00:00:05:13:93\r\n2019-01-02 17:57:51 INFO (MainThread) [zigpy.application] Removing device 0x40e6 (f0:d1:b8:00:00:05:13:93)\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.ezsp] Send command sendUnicast\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Sending: b'61542157541e155419944a7d31aa5592099d4e27aaecc4667d38eec3638944afcfa5168a7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Data frame: b'1754a157541e15ee31637e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Sending: b'82503a7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.ezsp] Application frame 52 (sendUnicast) received\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Data frame: b'2754b157546f15b259a0ca25aa1593499c80d8660b8e9874ffc763d7017e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Sending: b'83401b7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.ezsp] Application frame 69 (incomingMessageHandler) received\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.zigbee.application] No such device 16614\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Data frame: b'3754b157540ef3f2ca874f25aaed43b99e4dd854100e7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.uart] Sending: b'8430fc7e'\r\n2019-01-02 17:57:51 DEBUG (MainThread) [bellows.ezsp] Application frame 36 (trustCenterJoinHandler) received\r\n2019-01-02 17:57:51 INFO (MainThread) [zigpy.application] Device 0x40e6 (f0:d1:b8:00:00:05:13:93) left the network\r\n```\r\n\r\na different device, but same \"No such device\" to incoming 'incomingMessageHandler`\r\n```\r\n019-01-02 20:00:02 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_data=ieee_address=00:22:a3:00:00:1b:94:bb, domain=zha, service=remove>\r\n2019-01-02 20:00:02 INFO (MainThread) [homeassistant.components.zha] Removing node 00:22:a3:00:00:1b:94:bb\r\n2019-01-02 20:00:02 INFO (MainThread) [zigpy.application] Removing device 0x5991 (00:22:a3:00:00:1b:94:bb)\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.ezsp] Send command sendUnicast\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Sending: b'735d2157541e152300944a7d31aa5592099d4e27a2e4c46e3069dd63895f5c3fa5cc957e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Data frame: b'305da157541e1535dcc97e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Sending: b'8430fc7e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.ezsp] Application frame 52 (sendUnicast) received\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Data frame: b'405db157540e84ebe2005125aaf6b0499e4dd854ea817e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Sending: b'8520dd7e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.ezsp] Application frame 36 (trustCenterJoinHandler) received\r\n2019-01-02 20:00:02 INFO (MainThread) [zigpy.application] Device 0x5991 (00:22:a3:00:00:1b:94:bb) left the network\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Data frame: b'505db157546f15b259a0ca25aa1593499c50d87a7c979874ffcf638b68427e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Sending: b'8610be7e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.ezsp] Application frame 69 (incomingMessageHandler) received\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.zigbee.application] No such device 22929\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Data frame: b'605db1575415152300944a11aa5592099d4e272ce4ce6726d87e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.uart] Sending: b'87009f7e'\r\n2019-01-02 20:00:02 DEBUG (MainThread) [bellows.ezsp] Application frame 63 (messageSentHandler) received\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zigpy/zigpy/issues/comments/451048842","html_url":"https://github.com/zigpy/zigpy/pull/110#issuecomment-451048842","issue_url":"https://api.github.com/repos/zigpy/zigpy/issues/110","id":451048842,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTA0ODg0Mg==","user":{"login":"coveralls","id":2354108,"node_id":"MDQ6VXNlcjIzNTQxMDg=","avatar_url":"https://avatars1.githubusercontent.com/u/2354108?v=4","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T03:33:25Z","updated_at":"2019-01-03T03:33:25Z","author_association":"NONE","body":"## Pull Request Test Coverage Report for [Build 320](https://coveralls.io/builds/20878965)\n\n* **4** of **4**   **(100.0%)**  changed or added relevant lines in **1** file are covered.\n* No unchanged relevant lines lost coverage.\n* Overall coverage remained the same at **100.0%**\n\n---\n\n\n\n|  Totals | [![Coverage Status](https://coveralls.io/builds/20878965/badge)](https://coveralls.io/builds/20878965) |\n| :-- | --: |\n| Change from base [Build 318](https://coveralls.io/builds/20864989): |  0.0% |\n| Covered Lines: | 2146 |\n| Relevant Lines: | 2146 |\n\n---\n##### 💛  - [Coveralls](https://coveralls.io)\n"}}
{"actor":{"display_login":"coveralls"}}