mduran80 / daikin_madoka

Home Assistant custom component integration for the BRC1H thermostat (madoka)
MIT License
42 stars 10 forks source link

This service is already present in this BleakGATTServiceCollection! #4

Closed pacomm closed 3 years ago

pacomm commented 3 years ago

Since the last version of home assistant, the following error appears periodically:

Logger: pymadoka.connection Source: /usr/local/lib/python3.8/site-packages/pymadoka/connection.py:176 First occurred: 14:49:36 (5984 occurrences) Last logged: 18:17:59

This service is already present in this BleakGATTServiceCollection!

Log:

... 2021-04-20 18:26:15 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:17 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:19 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:22 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:24 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:26 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:28 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:30 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:32 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:34 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:36 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:38 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:40 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:42 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:44 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:47 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:49 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:51 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:53 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:55 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:57 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:26:59 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! 2021-04-20 18:27:01 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection! ...

mduran80 commented 3 years ago

Unfortunately, the pymadoka library requirements spec did not freeze the Bleak version. Bleak has released a new version that breaks the compatibility. First, it connects to the device and registers all the services into the collection. However, if the device is disconnected and the code tries to reconnect, the services are already there so the reported message appears.

I have bumped the version to the pymadoka 0.2.4 that freezes Bleak into the previous release until the issue is resolved.

By the way, this code is mostly unmaintained. All the updates are being made to the homeassistant/core repo where, hopefully, the integration will be merged soon (awaiting the PR approval).