Changes
🧰 Maintenance
- Removed ~1500 lines of duplicate code
- Improved maintainability and testability
- Maintains 100% API compatibility
- Major vw_vehicle.py Refactoring
- Centralized Path Constants: Introduced Paths class in vw_const.py with 78+ constants covering all vehicle data services
- Code Quality: Replaced 180+ hardcoded f-strings with maintainable Paths.* constants across vw_vehicle.py
- Safety Improvements: Enforced consistent is_valid_path() usage in all is_*_supported methods to prevent unnecessary error logging
- Helper Methods: Enhanced safety patterns for trip data, window/door state checks, and list inspection
- Add comprehensive type hints to all critical methods
- Extract window/door state helpers (_get_window_state, _get_door_state)
- Extract window/door support helpers (_is_window_supported, _is_door_supported)
- Extract trip data helpers (_get_trip_value, _is_trip_supported)
- Consolidate all trip properties (last/refuel/longterm) to use helpers
- Fix None-safety in temperature getters (hv_battery_min/max, climatisation_target)
- Fix None-safety in window heater, trunk lock, and parking light properties
- Fix trunk_closed to use correct helper (_get_door_state instead of _is_door_supported)
- Add proper None guards and .get() accessors throughout
- Minor vw_utilities.py Refactoring
🚀 Features
- Add device_class to Odometer
- Improve new login flow error messages
🐛 Bug Fixes
- Align units for consumption sensors
- Fixed potential TypeError in temperature conversions
- Fixed potential KeyError in list iterations
- Fixed trunk_closed returning support status instead of the actual state