zewelor / bt-mqtt-gateway

A simple Python script which provides a Bluetooth to MQTT gateway, easily extensible via custom workers. See https://github.com/zewelor/bt-mqtt-gateway/wiki for more information.
MIT License
548 stars 116 forks source link

Update lywsd03mmc.py for multiple retry when device connect fail #173

Closed Yvon-Indel closed 3 years ago

Yvon-Indel commented 4 years ago

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #169

Type of change

Add multiple retry when device connect fail.

Please delete options that are not relevant.

zewelor commented 4 years ago

Hi, thanks for PR.

I think it would be good to use this and merge it: https://github.com/zewelor/bt-mqtt-gateway/pull/61/files

As it would be better to have some general solution, consistent for all workers. Its easier to maintain it later.

Also I think it would be better to wrap https://github.com/zewelor/bt-mqtt-gateway/blob/90b3d3caddc6f58b740ff4de0a5ae9eb0152eb83/workers/lywsd03mmc.py#L25-L25 this line, as in linked PR.

Yvon-Indel commented 4 years ago

Hi, thanks for PR.

I think it would be good to use this and merge it: https://github.com/zewelor/bt-mqtt-gateway/pull/61/files

As it would be better to have some general solution, consistent for all workers. Its easier to maintain it later.

Also I think it would be better to wrap

https://github.com/zewelor/bt-mqtt-gateway/blob/90b3d3caddc6f58b740ff4de0a5ae9eb0152eb83/workers/lywsd03mmc.py#L25-L25

this line, as in linked PR.

Yes, i don't see it was already done for some other workers.

Did you have time to do it or should i try to merge ?

zewelor commented 4 years ago

Yes its not done for any worker now. I think its good direction, maybe you can try to merge this into new branch, and test it with lywsd device, and merge improvements from this branch: https://github.com/zewelor/bt-mqtt-gateway/pull/172 . I hope to merge it asap