Traceback (most recent call last):


 "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform

SLOW_SETUP_MAX_WAIT, loop=hass.loop)


 "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for

return fut.result()


 "/usr/lib/python3.5/asyncio/futures.py", line 293, in result

raise self._exception


 "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run

result = self.fn(*self.args, **self.kwargs)


 "/home/homeassistant/.homeassistant/custom_components/switch/tuya.py", line 48, in setup_platform

config.get(CONF_LOCAL_KEY)


 "/srv/homeassistant/lib/python3.5/site-packages/pytuya/__init__.py", line 249, in __init__

super(OutletDevice, self).__init__(dev_id, address, local_key, dev_type)


 "/srv/homeassistant/lib/python3.5/site-packages/pytuya/__init__.py", line 146, in __init__

self.local_key = local_key.encode('latin1')
AttributeError: 'NoneType' object has no attribute 'encode'

btlejack> Traceback (most recent call last):


 "/usr/lib/python3.8/site-packages/btlejack-2.0.0-py3.8.egg/btlejack/__init__.py", line 355, in main

supervisor.process_packets()


 "/usr/lib/python3.8/site-packages/btlejack-2.0.0-py3.8.egg/btlejack/supervisors.py", line 38, in process_packets

self.on_packet_received(pkt)


 "/usr/lib/python3.8/site-packages/btlejack-2.0.0-py3.8.egg/btlejack/ui.py", line 663, in on_packet_received

super().on_packet_received(packet)


 "/usr/lib/python3.8/site-packages/btlejack-2.0.0-py3.8.egg/btlejack/supervisors.py", line 331, in on_packet_received

self.on_ll_packet(packet)


 "/usr/lib/python3.8/site-packages/btlejack-2.0.0-py3.8.egg/btlejack/ui.py", line 628, in on_ll_packet

self._pt.on_ll_packet(packet)


 "/usr/lib/python3.8/site-packages/btlejack-2.0.0-py3.8.egg/btlejack/ui.py", line 274, in on_ll_packet

response = L2CAP.from_bytes(packet.data[12:]).payload.payload
AttributeError: 'NoneType' object has no attribute 'payload'
