Skip to content

Fix EVPoint Statin Supported Features Separator#1805

Open
lyubomirtraykov wants to merge 4 commits intolbbrhzn:mainfrom
lyubomirtraykov:fix-evpoint-supported-features
Open

Fix EVPoint Statin Supported Features Separator#1805
lyubomirtraykov wants to merge 4 commits intolbbrhzn:mainfrom
lyubomirtraykov:fix-evpoint-supported-features

Conversation

@lyubomirtraykov
Copy link
Copy Markdown

@lyubomirtraykov lyubomirtraykov commented Nov 15, 2025

The EVPoint charging stations are responding to SupportedFeatureProfiles with the fallowing format:

Core;FirmwareManagement;LocalAuthListManagement;Reservation;SmartCharging;RemoteTrigger

Summary by CodeRabbit

  • Bug Fixes
    • Improved parsing of feature/profile responses to normalize comma and semicolon separators, fixing cases where semicolon-delimited values were missed or misinterpreted. This yields more reliable detection and consistent behavior when devices return different separator formats.

The EVPoint charging stations are responding to SupportedFeatureProfiles with the fallowing format:
```
Core;FirmwareManagement;LocalAuthListManagement;Reservation;SmartCharging;RemoteTrigger
```
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 15, 2025

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 06ad5776-8142-4b6b-8097-cd22ce8baf7d

📥 Commits

Reviewing files that changed from the base of the PR and between a1a2df5 and ef57a72.

📒 Files selected for processing (1)
  • custom_components/ocpp/ocppv16.py
✅ Files skipped from review due to trivial changes (1)
  • custom_components/ocpp/ocppv16.py

📝 Walkthrough

Walkthrough

The get_supported_features function in the OCPP v1.6 component now replaces semicolons (;) with commas (,) in the configuration string before splitting, altering how feature lists are parsed from server responses.

Changes

Cohort / File(s) Summary
Feature profile separator normalization
custom_components/ocpp/ocppv16.py
get_supported_features now normalizes separators by replacing semicolons (;) with commas (,) before splitting the configuration value into a feature list.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

"I nibble semicolons, swap them for a comma,
parsing hums gently in the charger’s roomy tummy.
A tiny hop, a tidy line,
features split where they align. 🐰✨"

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing how the code parses semicolon-separated feature profiles from EVPoint charging stations in the SupportedFeatureProfiles response.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8e3c3c4 and 531be94.

📒 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 normalization
  • get_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.

@github-actions
Copy link
Copy Markdown

Stale pull request message

@lyubomirtraykov
Copy link
Copy Markdown
Author

Hello, I need one more approval to be able to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants