crownstone / crownstone-lib-python-uart

Library to communicate with the Crownstone network via the Crownstone USB dongle
Apache License 2.0
0 stars 4 forks source link

ufunc 'bitwise_xor' not supported for the input types #7

Closed hillstub closed 3 years ago

hillstub commented 3 years ago

Thanks for updating the home assistant library!!

After installing the update, I can now turn things on and off again. However, when I want to adjust the brightness it gives the following error:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 593, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 630, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 230, in async_handle_light_on_service
    await light.async_turn_on(**params)
  File "/config/custom_components/crownstone/light.py", line 223, in async_turn_on
    self.uart.dim_crownstone(
  File "/usr/local/lib/python3.8/site-packages/crownstone_uart/core/CrownstoneUart.py", line 112, in dim_crownstone
    self.mesh.set_crownstone_switch(crownstoneId, switchVal)
  File "/usr/local/lib/python3.8/site-packages/crownstone_uart/core/modules/MeshHandler.py", line 43, in set_crownstone_switch
    self._switch_crownstone(crownstone_id, switch_val)
  File "/usr/local/lib/python3.8/site-packages/crownstone_uart/core/modules/MeshHandler.py", line 66, in _switch_crownstone
    uartPacket = UartWrapperPacket(UartMessageType.UART_MESSAGE, uartMessage).getPacket()
  File "/usr/local/lib/python3.8/site-packages/crownstone_uart/core/uart/uartPackets/UartWrapperPacket.py", line 97, in getPacket
    packetCrc = UartUtil.crc16_ccitt(packet)
  File "/usr/local/lib/python3.8/site-packages/crownstone_uart/util/UartUtil.py", line 35, in crc16_ccitt
    crc ^= arr8[i]
TypeError: ufunc 'bitwise_xor' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
vliedel commented 3 years ago

Hey, thanks for reporting. I suspect this is due to a change from switch commands being between 0 and 1.0, to them being between 0 and 100. I'll check with the HA integration maintainer.

vliedel commented 3 years ago

It should be fixed by the HA 1.6.0 release.