A Q-Learning-based Energy Efficiency Optimization in LoRa Networks