π Energy Consumption & Charging State Fixes
β
Fixed negative energy values when the charger resets (stored_power > total_energy_wh).
β
Corrected session energy display to prevent redundant values (X kWh of X kWh).
β
Added charger reset detection with logs when stored_power > total_energy_wh.
π Improved Charging State Handling
β
Modified "charging stopped" notification (only when charging ends, not on cable unplugging).
β
Prevented "charging stopped" from triggering on cable disconnection.
β
Introduced cable connection & disconnection detection:
β’ "π Cable disconnected" is only sent once, when unplugging.
β’ "π Cable connected" is only sent once, when replugging.
β
Ensured state is saved correctly in STATE_FILE:
β’ "disconnected" is now properly recorded instead of defaulting to "idle".
β’ When the cable is reconnected, it transitions back to "idle" or "charging" correctly.
π Fetching & Error Handling Improvements
β
Ensured 30-second retry loop in fetch_charging_status() and logged each attempt for debugging.
β
Improved exception handling in fetch_charging_status() (catches NoSuchElementException, TimeoutException).
β
Fixed missing exception handling in main():
β’ Catches all errors and logs them as CRITICAL.
β’ Sends a Discord alert when an unexpected error occurs.
β’ Ensures driver.quit() always runs, even if an exception happens.
π Improved Discord Notifications
β
Added Discord alerts when:
β’ Fetching fails after 30 retries.
β’ A fatal error occurs in fetch_charging_status().
β’ Cable is unplugged (π Cable disconnected).
β’ Cable is reconnected (π Cable connected).
π Prevented Notification Spam
β
Tracked in STATE_FILE so alerts are sent only when the state changes.
Full Changelog: v1.0.6...v1.1.0