cmcgerty / Sofar2mqtt

A smart home interface for Sofar solar and battery inverters.
GNU General Public License v3.0
79 stars 45 forks source link

control reaches end of non-void function [-Werror=return-type] #19

Closed Tinbum1 closed 2 years ago

Tinbum1 commented 2 years ago

I'm having trouble compiling for the ME3000 and getting the above message and the last line of this part of the sketch highlighted; unsigned int batteryWatts() { if (INVERTER_RUNNINGSTATE == charging || INVERTER_RUNNINGSTATE == discharging) { modbusResponce responce = sendModbus(getBatteryPower, sizeof(getBatteryPower)); if (responce.errorLevel == 0) { unsigned int w = ((responce.data[0] << 8) | responce.data[1]); switch (INVERTER_RUNNINGSTATE) { case charging: w = w * 10; break; case discharging: w = (65535 - w) * 10; break; return w; } } else { Serial.println(responce.errorMessage); updateOLED("NULL", "NULL", "CRC-FAULT", "NULL"); } } else { return 0; } } HERE

cmcgerty commented 2 years ago

Hi @Tinbum1 V2.0 beta1 has been published today, which is a major write and bring much greater stability. See if that is better for you.