Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to control devices over BLE - Failed to perform the action light/turn_on. 'NoneType' object has no attribute 'write_gatt_char' #59

Open
padgriffin opened this issue Dec 16, 2024 · 1 comment

Comments

@padgriffin
Copy link

Version of the integration

0.1.1

Device setup

H617C, H618A

Describe the bug

Device cannot be controlled via integration, outputs "AttributeError: 'NoneType' object has no attribute 'write_gatt_char'". Device is detected by HA and able to be added, but errors when a command is given.

Debug log


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 628, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/config/custom_components/govee-ble-lights/light.py", line 277, in async_turn_on
    await client.write_gatt_char(UUID_CONTROL_CHARACTERISTIC, command, False)
          ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write_gatt_char'

@padgriffin
Copy link
Author

Rombond's H617A BLE fork seems to have fixed this and reliably controls the H617C.

https://github.com/Rombond/h617a_govee_ble_lights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant