xreef / EByte_LoRa_E220_python_raspberrypi_library

Other
6 stars 0 forks source link

Error in class Transmission Power. #1

Closed Dreamerandhardworker closed 2 months ago

Dreamerandhardworker commented 3 months ago

Error in class Transmission Power. In def get_transmission_power(self), we will always get into if self.transmission_power == self.transmission_power. That is, there will always be Transmission Power 22. Yes?

Engino00 commented 3 months ago

@Dreamerandhardworker Yes I also found this issue. I solve it with:

#file lora_e220_constants.py - from line 303
def get_transmission_power(self):
        if self.transmission_power == 22:
            return TransmissionPower22
        elif self.transmission_power == 30:
            return TransmissionPower30
        else:
            return "Invalid transmission power param"

Also, remember that when using the commands to directly set the transmission power: configuration_to_set.OPTION.transmissionPower = TransmissionPower22.POWER_xy or configuration_to_set.OPTION.transmissionPower = TransmissionPower30.POWER_xy

you should import the respective class using: from lora_e220_constants import TransmissionPower22, TransmissionPower30

xreef commented 2 months ago

Hi, thanks to all, I fixed It. Bye Renzo