t3chguy / pinecil_ble

Integrates Pinecil v2 soldering iron into HomeAssistant via BLE
MIT License
17 stars 1 forks source link

Setup error in 'rewrite' branch. #4

Open Particpant opened 9 months ago

Particpant commented 9 months ago

Entirely possible I botched the manual install (HACS doesn't seem to allow selecting an alternate branch.) Here's what I get after autodiscovery runs:

Source: config_entries.py:406
First occurred: 2:05:47 PM (5 occurrences)
Last logged: 2:08:13 PM

Error setting up entry Pinecil-2010961 for pinecil_ble
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pinecil_ble/__init__.py", line 51, in async_setup_entry
    coordinator = hass.data[DOMAIN][entry.entry_id] = PinecilDataUpdateCoordinator(
                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pinecil_ble/coordinator.py", line 38, in __init__
    super().__init__(
TypeError: ActiveBluetoothProcessorCoordinator.__init__() missing 1 required keyword-only argument: 'update_method'
t3chguy commented 9 months ago

I think I accidentally committed ActiveBluetoothProcessorCoordinator instead of ActiveBluetoothDataUpdateCoordinator

Particpant commented 8 months ago

I asked around and here was the reply I got: https://community.home-assistant.io/t/activebluetooth-and-forced-polling-pinecil/682558/4?u=participant

For that use case ActiveBluetoothCoordinator is probably fine as long as you disconnect right after you poll for data so it starts advertising again.

xiaomi_ble does this for the plant sensors to get the battery state

https://github.com/home-assistant/core/tree/dev/homeassistant/components/xiaomi_ble

On the other hand, hopefully the pinecil can just start advertising when connected if the firmware PR is completed to do that. The other branch seems to mainly work fine, though.

Thanks for giving this a shot.