{"action":"created","issue":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/4997","repository_url":"https://api.github.com/repos/home-assistant/home-assistant","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/4997/labels{/name}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/4997/comments","events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/4997/events","html_url":"https://github.com/home-assistant/home-assistant/issues/4997","id":196357506,"number":4997,"title":"Broadlink Compontent/lib dies after multiple back to back commands used","user":{"login":"maddox","id":260,"avatar_url":"https://avatars.githubusercontent.com/u/260?v=3","gravatar_id":"","url":"https://api.github.com/users/maddox","html_url":"https://github.com/maddox","followers_url":"https://api.github.com/users/maddox/followers","following_url":"https://api.github.com/users/maddox/following{/other_user}","gists_url":"https://api.github.com/users/maddox/gists{/gist_id}","starred_url":"https://api.github.com/users/maddox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maddox/subscriptions","organizations_url":"https://api.github.com/users/maddox/orgs","repos_url":"https://api.github.com/users/maddox/repos","events_url":"https://api.github.com/users/maddox/events{/privacy}","received_events_url":"https://api.github.com/users/maddox/received_events","type":"User","site_admin":true},"labels":[{"id":214631394,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/problem%20in%20dependency","name":"problem in dependency","color":"e10d10","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":33,"created_at":"2016-12-19T08:36:52Z","updated_at":"2016-12-21T11:41:17Z","closed_at":null,"body":"\r\n\r\n\r\n**Home Assistant release (`hass --version`):**\r\n0.35.2\r\n\r\n**Python release (`python3 --version`):**\r\n3.5.1\r\n\r\n**Component/platform:**\r\nBroadlink\r\n\r\n**Description of problem:**\r\nBroadlink component eventually starts throwing an error and will no longer function. Restarting HA fixes the issue.\r\n\r\nerror:\r\n\r\n`ValueError: AES key must be either 16, 24, or 32 bytes long`\r\n\r\n**Expected:**\r\nNot to break :trollface:\r\n\r\n**Traceback (if applicable):**\r\n```bash\r\nINFO:homeassistant.components.http:Serving /api/services/homeassistant/turn_off to 127.0.0.1 (auth: True)\r\nINFO:homeassistant.core:Bus:Handling <Event call_service[L]: domain=homeassistant, service_call_id=4364246992-15, service=turn_off, service_data=entity_id=switch.holiday_pink_tree>\r\nINFO:homeassistant.core:Bus:Handling <Event call_service[L]: domain=switch, service_call_id=4364246992-16, service=turn_off, service_data=entity_id=['switch.holiday_pink_tree']>\r\nERROR:homeassistant.core:Error doing job: Task exception was never retrieved\r\nTraceback (most recent call last):\r\n  File \"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/tasks.py\", line 241, in _step\r\n    result = coro.throw(exc)\r\n  File \"/usr/local/lib/python3.5/site-packages/homeassistant/core.py\", line 1049, in _event_to_service_call\r\n    yield from service_handler.func(service_call)\r\n  File \"/usr/local/lib/python3.5/site-packages/homeassistant/components/switch/__init__.py\", line 91, in async_handle_switch_service\r\n    yield from switch.async_turn_off()\r\n  File \"/usr/local/lib/python3.5/site-packages/homeassistant/helpers/entity.py\", line 363, in async_turn_off\r\n    None, ft.partial(self.turn_off, **kwargs))\r\n  File \"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/futures.py\", line 358, in __iter__\r\n    yield self  # This tells Task to wait for completion.\r\n  File \"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/tasks.py\", line 290, in _wakeup\r\n    future.result()\r\n  File \"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/futures.py\", line 274, in result\r\n    raise self._exception\r\n  File \"/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/concurrent/futures/thread.py\", line 55, in run\r\n    result = self.fn(*self.args, **self.kwargs)\r\n  File \"/usr/local/lib/python3.5/site-packages/homeassistant/components/switch/broadlink.py\", line 139, in turn_off\r\n    if self._sendpacket(self._command_off):\r\n  File \"/usr/local/lib/python3.5/site-packages/homeassistant/components/switch/broadlink.py\", line 148, in _sendpacket\r\n    self._device.send_data(packet)\r\n  File \"/Users/jmaddox/.homeassistant/deps/broadlink/__init__.py\", line 376, in send_data\r\n    self.send_packet(0x6a, packet)\r\n  File \"/Users/jmaddox/.homeassistant/deps/broadlink/__init__.py\", line 214, in send_packet\r\n    aes = AES.new(bytes(self.key), AES.MODE_CBC, bytes(self.iv))\r\n  File \"/usr/local/lib/python3.5/site-packages/Crypto/Cipher/AES.py\", line 95, in new\r\n    return AESCipher(key, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.5/site-packages/Crypto/Cipher/AES.py\", line 59, in __init__\r\n    blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.5/site-packages/Crypto/Cipher/blockalgo.py\", line 141, in __init__\r\n    self._cipher = factory.new(key, *args, **kwargs)\r\nValueError: AES key must be either 16, 24, or 32 bytes long\r\n```\r\n\r\n**Additional info:**\r\n\r\nThis is reproducible by doing lots of back to back commands via the broadlink. It's almost like it gets overloaded. I get this problem when I use my `Good Night` scene, which turns off about 5-6 different sets of holiday lights that use RF switches.\r\n\r\nThis is very consistent. "},"comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/comments/268502685","html_url":"https://github.com/home-assistant/home-assistant/issues/4997#issuecomment-268502685","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/4997","id":268502685,"user":{"login":"12-hak","id":5181825,"avatar_url":"https://avatars.githubusercontent.com/u/5181825?v=3","gravatar_id":"","url":"https://api.github.com/users/12-hak","html_url":"https://github.com/12-hak","followers_url":"https://api.github.com/users/12-hak/followers","following_url":"https://api.github.com/users/12-hak/following{/other_user}","gists_url":"https://api.github.com/users/12-hak/gists{/gist_id}","starred_url":"https://api.github.com/users/12-hak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/12-hak/subscriptions","organizations_url":"https://api.github.com/users/12-hak/orgs","repos_url":"https://api.github.com/users/12-hak/repos","events_url":"https://api.github.com/users/12-hak/events{/privacy}","received_events_url":"https://api.github.com/users/12-hak/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T11:41:17Z","updated_at":"2016-12-21T11:41:17Z","body":"TypeError: _auth() missing 1 required positional argument: 'packet'\r\n"}}
{"actor":{"display_login":"12-hak"}}