klali / ha-plejd

Plejd component for Home Assistant
Apache License 2.0
69 stars 15 forks source link

Error while setting up platform plejd on raspberry pi4 #19

Closed atrampare closed 4 years ago

atrampare commented 4 years ago

Iv moved my hassio installation to a pi 4 and can't get i to work. I get this error from the log file. Anyone got a clue of whats wrong?

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/plejd/light.py", line 310, in setup_platform cryptokey = binascii.a2b_hex(config.get(CONF_CRYPTO_KEY)) binascii.Error: Odd-length string

mudape commented 4 years ago

Hi, Looks like your crypto_key string isn't 32 characters long.

light:

Did you store it in secrets.yaml and maybe forgotten to move that? Make sure you remove all '-' characters.

I've changed line 299 in light.py to: cryptokey = binascii.a2b_hex(config.get(CONF_CRYPTO_KEY).replace('-', ''))

atrampare commented 4 years ago

Got it working now. It forgot to remove the '-' in the key:-o

Thanks

klali commented 4 years ago

Great that you got it working.

@mudape if you want to I'd accept a pull request with that change.