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
100 stars 43 forks source link

PluginConf naming is not the same as DeviceList for HardwareId with only one digit #383

Closed SylvainPer closed 5 years ago

SylvainPer commented 5 years ago

For example, with 'HardwareID':'2', the files are: DeviceList-2.txt PluginConf-02.txt

due to

        # Import PluginConf.txt
        self.filename = self.pluginConfig + "PluginConf-%02d.txt" %hardwareid
        if not os.path.isfile(self.filename) :
            self.filename = self.pluginConfig + "PluginConf.txt"

in PluginConf.py l84

pipiche38 commented 5 years ago

Thanks for reporting the issue and agree with you that there is a lack of consistency here. And this is bringing also an other issue which might happen in case the HardwareID of the plugin is above 99 in Domoticz, we would face an other issue. The probability to reach that number is somehow limited, but still exist.

SylvainPer commented 5 years ago

Not sure that there is a problem for 3 digits, %02d only add 0 to have 2 digits but do nothing if the number is >= 10. It's not a limitation to 2 digits.

pipiche38 commented 5 years ago

1a38084..4096686