Taking EVSE chargepoints off of Meters category by refactoring getFactoriesByNature to support multiple exclusions#3672
Conversation
…king EVSE of of Meters To avoid EVSE chargepoints ending up in the Meters category, this fix allows more then one exclusion per category, now allowing a list. It is used to enhance the CATEGORY.TITLE.METER with not only excluding evcs.api.Evcs, but also evse.api.chargepoint.EvseChargePoint.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3672 +/- ##
=============================================
+ Coverage 60.13% 62.35% +2.23%
Complexity 104 104
=============================================
Files 3209 2901 -308
Lines 141232 132138 -9094
Branches 10402 8868 -1534
=============================================
- Hits 84910 82382 -2528
+ Misses 53157 46731 -6426
+ Partials 3165 3025 -140 🚀 New features to boost your workflow:
|
|
Can someone please help me with this linter issue in the CI? If I run the sequence locally: "All files pass linting." Beyond that: It complains that Therefore: How can I make this PR acceptable and let it pass the linter? |
|
@lukasrgr Could you please have a look? |
| * @param excludeNature an optional name of a Nature (or list of Natures) to be excluded | ||
| */ | ||
| public static getFactoriesByNature(factories: { [id: string]: EdgeConfig.Factory }, includeNature: string, excludeNature?: string): EdgeConfig.Factory[] { | ||
| public static getFactoriesByNature(factories: { [id: string]: EdgeConfig.Factory }, includeNature: string, excludeNature?: string | string[]): EdgeConfig.Factory[] { |
There was a problem hiding this comment.
includeNature and excludeNature could be two different types then, i would probably only expect a string if includeNature is a string,
if you just use string[] as param type, you could also save yourself from checking if it is an array or not
There was a problem hiding this comment.
I did not want to break anything. Therefore I kept string and just added another option.
But if you prefer just string[], this is fine for me..
Shall I do it, or do you want to take over?
To avoid EVSE chargepoints ending up in the Meters category, this fix allows more then one exclusion per category, now allowing a list. It is used to enhance the CATEGORY.TITLE.METER with not only excluding evcs.api.Evcs, but also evse.api.chargepoint.EvseChargePoint.