Fix EVPoint Statin Supported Features Separator#1805
Fix EVPoint Statin Supported Features Separator#1805lyubomirtraykov wants to merge 4 commits intolbbrhzn:mainfrom
Conversation
The EVPoint charging stations are responding to SupportedFeatureProfiles with the fallowing format: ``` Core;FirmwareManagement;LocalAuthListManagement;Reservation;SmartCharging;RemoteTrigger ```
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
custom_components/ocpp/ocppv16.py (1)
258-295: Consider adding debug logging for observability.While the fix correctly handles both separators, adding debug logging when semicolons are detected could help track which charging stations use non-standard separators. This would be useful for future compatibility analysis.
Optionally, add logging before the normalization:
resp = await self.call(req) try: + raw_value = resp.configuration_key[0][om.value.value] + if ";" in raw_value: + _LOGGER.debug("'%s' uses semicolon separator in SupportedFeatureProfiles: %s", self.id, raw_value) - feature_list = (resp.configuration_key[0][om.value.value]).replace(";", ",").split(",") + feature_list = raw_value.replace(";", ",").split(",") except (IndexError, KeyError, TypeError):
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
custom_components/ocpp/ocppv16.py(1 hunks)
🔇 Additional comments (2)
custom_components/ocpp/ocppv16.py (2)
264-264: LGTM! Clean fix for separator normalization.The change correctly handles EVPoint charging stations that return semicolon-separated feature profiles while maintaining backward compatibility with comma-separated lists. The normalization approach is simple and effective.
264-264: Fix is correctly targeted to SupportedFeatureProfiles; no similar issues identified elsewhere.The verification confirms the normalization at line 264 addresses the specific case of
SupportedFeatureProfiles. The codebase architecture separates this concern appropriately:
get_supported_feature_profiles()(line 264): Dedicated method handling this specific key with normalizationget_configuration(key)(line 790): Generic method returning raw values for other keys (heartbeat_interval, charging_schedule_allowed_charging_rate_unit, etc.)No other configuration keys in the codebase apply semicolon-to-comma normalization, and the scalar values retrieved by
get_configuration()do not require similar handling. The design is sound.
|
Stale pull request message |
|
Hello, I need one more approval to be able to merge. |
The EVPoint charging stations are responding to SupportedFeatureProfiles with the fallowing format:
Summary by CodeRabbit