Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add meanwell drs template #859

Merged
merged 14 commits into from
Jan 29, 2025
Merged

Conversation

BurchuMikhail
Copy link
Contributor

@BurchuMikhail BurchuMikhail commented Jan 28, 2025

Добавлен шаблон для MEANWELL DRS Series

Summary by CodeRabbit

  • New Features
    • Added configuration template for MEANWELL-DRS-Series device.
    • Introduced version 2.154.0 of the wb-mqtt-serial package with a new template for the MEANWELL-DRS-Series device.
  • Bug Fixes
    • Fixed the changelog entry for the wb-mqtt-serial package in version 2.153.3.

BurchuMikhail and others added 7 commits January 27, 2025 09:32
Добавлен файл шаблона (пустой)
Добавлены каналы для группы Состояние устройства.
Добавлены каналы в Состояние устройства
Добавлены все необходимые каналы и параметры
Добавлены каналы в файл теста
Увеличен номер версии
@BurchuMikhail BurchuMikhail requested review from a team, KraPete and sikmir as code owners January 28, 2025 10:22
Copy link

coderabbitai bot commented Jan 28, 2025

Walkthrough

A new version (2.154.0) of the wb-mqtt-serial package has been released, introducing a new template for the "meanwell-drs-series" device. The previous version noted was 2.153.3, which included a fix for the changelog and updates for continuous integration (CI) processes. The changelog for version 2.154.0 maintains consistency in formatting and includes the author's contact information. Additionally, a new JSON configuration file for the MEANWELL DRS Series device has been added, detailing its parameters, channels, and multi-language support.

Changes

File Change Summary
debian/changelog Added new version 2.154.0 entry for wb-mqtt-serial package with a new template for meanwell-drs-series. Updated previous entry for version 2.153.3 with a changelog fix and CI updates.
templates/config-meanwell-drs.json New JSON configuration file for MEANWELL DRS Series device, including structured parameters and channels with multi-language support.

Possibly related PRs

Suggested reviewers

  • KraPete
  • sikmir

Poem

🐰 In the meadow of code, a new version does bloom,
With templates for devices, it brightens the room.
MEANWELL DRS, with settings so fine,
Hops into action, with parameters that shine.
Version 2.154.0, let’s celebrate with glee! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ab3755 and 6a16874.

⛔ Files ignored due to path filters (1)
  • test/TDeviceTemplatesTest.Validate.dat is excluded by !**/*.dat
📒 Files selected for processing (1)
  • debian/changelog (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
debian/changelog (1)

1-11: LGTM! Well-formatted changelog entries.

The changelog entries for versions 2.154.0 and 2.153.3 are properly formatted following the Debian changelog conventions, with all required fields present and clear descriptions of changes.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 3

🧹 Nitpick comments (1)
templates/config-meanwell-drs.json (1)

573-576: Improve organization of Russian translations.

Consider moving group titles to a dedicated section in the Russian translations for better maintainability:

             "ru": {
                 "template_title": "MEANWELL DRS Series - многофункциональный источник питания",
+                "groups": {
+                    "power_status": "Состояние питания",
+                    "unit_status": "Состояние устройства",
+                    "settings": "Настройка",
+                    "hw_info": "Данные устройства"
+                },
-                "Power Status": "Состояние питания",
-                "Unit Status": "Состояние устройства",
-                "Settings": "Настройка",
-                "HW Info": "Данные устройства",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17c82e6 and 3252fe2.

⛔ Files ignored due to path filters (1)
  • test/TDeviceTemplatesTest.Validate.dat is excluded by !**/*.dat
📒 Files selected for processing (2)
  • debian/changelog (1 hunks)
  • templates/config-meanwell-drs.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • debian/changelog
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
templates/config-meanwell-drs.json (2)

1-21: LGTM! Well-structured device metadata and logical grouping.

The device metadata and groups are well-organized, following a clear logical structure for power status, unit status, and settings.


1-634: Overall template structure is well-designed.

The template provides a comprehensive configuration for the MEANWELL DRS Series power supply, with well-organized parameters, channels, and multi-language support. The validation ranges, scaling factors, and grouping of functionality are logically structured.

Comment on lines 293 to 296
"Undefined",
"Сonstant Сurrent",
"Сonstant Voltage",
"Float Mode"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix character encoding in enum titles.

The enum titles use Cyrillic 'С' instead of Latin 'C':

-                    "Сonstant Сurrent",
-                    "Сonstant Voltage",
+                    "Constant Current",
+                    "Constant Voltage",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Undefined",
"Сonstant Сurrent",
"Сonstant Voltage",
"Float Mode"
"Undefined",
"Constant Current",
"Constant Voltage",
"Float Mode"

Comment on lines 550 to 552
"current_dc": "Сurrent DC",
"battery_voltage": "Battery Voltage",
"battery_current": "Battery Сurrent",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistent capitalization in translations.

The English translations use inconsistent capitalization and Cyrillic characters:

-                "current_dc": "Сurrent DC",
-                "battery_current": "Battery Сurrent",
+                "current_dc": "Current DC",
+                "battery_current": "Battery Current",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"current_dc": "Сurrent DC",
"battery_voltage": "Battery Voltage",
"battery_current": "Battery Сurrent",
"current_dc": "Current DC",
"battery_voltage": "Battery Voltage",
"battery_current": "Battery Current",

Comment on lines 108 to 132
"title": "battary_low_voltage_setpoint",
"id": "battary_low_voltage_setpoint",
"address": 208,
"reg_type": "holding",
"default": 20.9,
"min": 9.6,
"max": 48,
"scale": 0.01,
"required": false,
"order": 7,
"group": "settings"
},
{
"title": "battary_critical_voltage_setpoint",
"id": "battary_critical_voltage_setpoint",
"address": 209,
"reg_type": "holding",
"default": 16.8,
"min": 8.4,
"max": 48,
"scale": 0.01,
"required": false,
"order": 8,
"group": "settings"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix spelling errors in parameter names.

The word "battery" is misspelled as "battary" in two parameter names:

-                "title": "battary_low_voltage_setpoint",
-                "id": "battary_low_voltage_setpoint",
+                "title": "battery_low_voltage_setpoint",
+                "id": "battery_low_voltage_setpoint",
-                "title": "battary_critical_voltage_setpoint",
-                "id": "battary_critical_voltage_setpoint",
+                "title": "battery_critical_voltage_setpoint",
+                "id": "battery_critical_voltage_setpoint",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"title": "battary_low_voltage_setpoint",
"id": "battary_low_voltage_setpoint",
"address": 208,
"reg_type": "holding",
"default": 20.9,
"min": 9.6,
"max": 48,
"scale": 0.01,
"required": false,
"order": 7,
"group": "settings"
},
{
"title": "battary_critical_voltage_setpoint",
"id": "battary_critical_voltage_setpoint",
"address": 209,
"reg_type": "holding",
"default": 16.8,
"min": 8.4,
"max": 48,
"scale": 0.01,
"required": false,
"order": 8,
"group": "settings"
},
"title": "battery_low_voltage_setpoint",
"id": "battery_low_voltage_setpoint",
"address": 208,
"reg_type": "holding",
"default": 20.9,
"min": 9.6,
"max": 48,
"scale": 0.01,
"required": false,
"order": 7,
"group": "settings"
},
{
"title": "battery_critical_voltage_setpoint",
"id": "battery_critical_voltage_setpoint",
"address": 209,
"reg_type": "holding",
"default": 16.8,
"min": 8.4,
"max": 48,
"scale": 0.01,
"required": false,
"order": 8,
"group": "settings"
},

Update config-meanwell-drs.json
Copy link

@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)
templates/config-meanwell-drs.json (1)

281-282: Document disabled channels.

Several channels are disabled by default. Consider adding documentation to explain:

  • Why these channels are disabled
  • Under what conditions they should be enabled
  • Which device models support these features

Also applies to: 315-316, 397-398, 414-415, 431-432, 448-449, 465-466, 482-483, 499-500, 516-517

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3252fe2 and 9d653e1.

📒 Files selected for processing (1)
  • templates/config-meanwell-drs.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
templates/config-meanwell-drs.json (4)

1-21: LGTM! Well-structured device metadata.

The device metadata is well-organized with clear grouping of functionality.


138-140: Verify timeout units conversion.

The timeout parameters have values in seconds (60-64800) but their translations show "Min" as the unit. This might cause confusion. Consider either:

  1. Adjusting the scale to 1/60 to match the displayed minutes, or
  2. Updating the translations to clarify the unit conversion.

Also applies to: 150-152, 162-164


608-609: Fix character encoding in enum titles.

The enum titles use Cyrillic 'С' instead of Latin 'C':

-                    "Сonstant Сurrent": "Постоянный ток",
-                    "Сonstant Voltage": "Постоянное напряжение",
+                    "Constant Current": "Постоянный ток",
+                    "Constant Voltage": "Постоянное напряжение",

551-551: Fix inconsistent capitalization in translations.

The English translations use inconsistent capitalization and Cyrillic characters:

-                "current_dc_status": "Сurrent DC Status",
-                "battery_current": "Battery Сurrent",
+                "current_dc_status": "Current DC Status",
+                "battery_current": "Battery Current",

Also applies to: 561-561

Copy link

@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)
templates/config-meanwell-drs.json (1)

3-3: Standardize device naming convention.

The device type and name use inconsistent hyphenation:

-    "device_type": "MEAN-WELL-DRS-Series",
-        "name": "MEAN WELL DRS Series",
+    "device_type": "MEAN-WELL-DRS-Series",
+        "name": "MEAN-WELL-DRS-Series",

Also applies to: 6-6

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9008521 and 0ab3755.

📒 Files selected for processing (1)
  • templates/config-meanwell-drs.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (3)
templates/config-meanwell-drs.json (3)

22-169: Parameters section is well-structured!

Good job on:

  • Proper validation ranges and scaling factors
  • Logical grouping and ordering
  • Consistent naming and structure

287-291: Verify battery charge mode enum values.

The enum values skip from 2 to 4. Is this intentional according to the device's protocol, or should it be sequential (0,1,2,3)?


552-552: Fix character encoding in translations.

The following translations still use Cyrillic 'С' instead of Latin 'C':

-                "battery_current": "Battery Сurrent",
-                "current_dc_status": "Сurrent DC Status",
-                "Сonstant Сurrent": "Постоянный ток",
-                "Сonstant Voltage": "Постоянное напряжение",
+                "battery_current": "Battery Current",
+                "current_dc_status": "Current DC Status",
+                "Constant Current": "Постоянный ток",
+                "Constant Voltage": "Постоянное напряжение",

Also applies to: 561-561, 608-609

@BurchuMikhail BurchuMikhail merged commit 52b2631 into master Jan 29, 2025
14 checks passed
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