zigbeefordomoticz / Domoticz-Zigbee

Zigbee plugin for Domoticz. Allow to connect various zigbee controllers like Zigate but also Texas Instrument CC2531, CC13x2, CC26x2 ; Silicon-Labs; deConz based chipset to be connected to Domoticz
GNU General Public License v3.0
99 stars 43 forks source link

Platform.dist() removed since Python3.7 #1604

Closed CocoRid closed 1 year ago

CocoRid commented 1 year ago

Describe the bug The following error message appeared in Domoticz log, every restart : "Error: Zigate: switchPiZigate_mode - unable to find distribution: Assuming debian, Error: module 'platform' has no attribute 'dist'"

Why still using "platform.dist()" or even "platform.linux_distribution()" in "Modules/piZigate.py", it's removed since Python 3.7 and your plugin require Python 3.8 or higher (Platform Unix Platforms) ? Can you check to use another function, that is available and not already deprecated (as "distro.linux_distribution()" 😄)?

To Reproduce => Just restart Domoticz

Expected behavior Not have this error message

Plugin (please complete the following information):

pipiche38 commented 1 year ago

Thanks for that. Would you mind creating a PR ? I'mnot using any PiZigate nor the Raspbian distrib

pipiche38 commented 1 year ago

@CocoRid is that something you can help and provide a PR ?

CocoRid commented 1 year ago

Hello I will do a pull request soon about this. It's not blocking.

Just : what is expected at lines 55/56 ? Linux distribution will return "raspbian" and not "debian". Actually forced as Debian, i have to see if the fonction called at Line 56 really works.