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

Yepkit ykush driver #249

Merged
merged 2 commits into from
Feb 6, 2025
Merged

Yepkit ykush driver #249

merged 2 commits into from
Feb 6, 2025

Conversation

mangelajo
Copy link
Member

@mangelajo mangelajo commented Feb 4, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new Yepkit Ykush driver for managing power control on USB hub devices.
    • Updated driver creation commands to streamline generating the new driver scaffold.
  • Documentation

    • Added comprehensive documentation with configuration examples, API usage, and command-line instructions for the Yepkit driver.
    • Updated the README to guide users on implementing the new driver.
  • Chores

    • Refined project setup and build configurations to support the updated driver structure.
    • Introduced a new configuration file to define project metadata and dependencies.

Copy link
Contributor

coderabbitai bot commented Feb 4, 2025

Warning

Rate limit exceeded

@mangelajo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 22 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between be1e70b and f933e09.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • docs/source/api-reference/drivers/yepkit.md (1 hunks)
  • packages/jumpstarter-driver-yepkit/README.md (1 hunks)
  • packages/jumpstarter-driver-yepkit/examples/exporter.yaml (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/conftest.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver_test.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/pyproject.toml (1 hunks)

Walkthrough

The changes update the driver scaffold creation process by rebranding from the "shell" driver to a new "yepkit" (Ykush) driver. The command in the contribution instructions and the file creation paths have been modified accordingly. The create_driver.sh script now uses a hyphenated naming convention for driver directories and consolidated template file paths. New documentation, exporter configuration, driver implementation, testing hooks, and a project metadata file have been added to support the Yepkit driver functionality.

Changes

File(s) Change Summary
CONTRIB.md Updated driver scaffold command from "shell" to "yepkit" (Ykush) and changed output file paths from contrib/drivers/shell/ to packages/jumpstarter_driver_yepkit/.
__templates__/create_driver.sh Modified driver directory naming to hyphenated format and consolidated template file paths to use __templates__/ exclusively.
docs/source/api-reference/drivers/yepkit.md, packages/jumpstarter-driver-yepkit/README.md Added new documentation detailing the Yepkit driver configuration, API reference, and introduced a package header.
packages/jumpstarter-driver-yepkit/examples/exporter.yaml Introduced a new exporter configuration with multiple power settings for managing the Yepkit driver.
packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/conftest.py Added a pytest hook (pytest_runtest_call) to gracefully skip tests when encountering file or USB-related errors.
packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py,
packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver_test.py
Introduced the Ykush driver class with power control methods (client, reset, on, off, read) along with tests that use a serve utility for lifecycle management.
packages/jumpstarter-driver-yepkit/pyproject.toml Added new project metadata, build system configuration, and dependency settings for the Yepkit driver package.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Runner
    participant Hook as Pytest Hook
    participant Driver as Ykush Driver
    participant USB as USB Device

    Test->>Hook: Execute test (pytest_runtest_call)
    alt File/USB Error
        Hook->>Test: Skip test with appropriate message
    else Normal Execution
        Test->>Driver: Initialize and call on() method
        Driver->>USB: Send power on command
        USB-->>Driver: Acknowledge power on
        Test->>Driver: Call off() method to power off
        Driver->>USB: Send power off command
        USB-->>Driver: Acknowledge power off
    end
Loading

Possibly related PRs

Suggested Reviewers

  • NickCao

Poem

I'm a little rabbit in a code-filled glen,
Hopping through changes again and again.
From shell to yepkit, the paths now align,
With scripts and docs all looking divine.
Power on, power off – a hop, skip, and cheer,
Celebrating fresh code in our tech frontier!
🐰✨


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
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

🔭 Outside diff range comments (1)
CONTRIB.md (1)

31-35: Sync Log Output Inconsistency – Update Package Name

The sync log output (lines 31–35) still references jumpstarter-driver-shell and paths under contrib/drivers/shell. Since the scaffold now targets the Yepkit driver, these references should be updated to reflect the new package name (jumpstarter-driver-yepkit). This discrepancy might confuse users reviewing the logs.

A potential diff for correction:

-   Built jumpstarter-driver-shell @ file:///Users/ajo/work/jumpstarter/contrib/drivers/shell
+   Built jumpstarter-driver-yepkit @ file:///Users/ajo/work/jumpstarter-driver-yepkit
...
- ~ jumpstarter-driver-shell==0.1.0 (from file:///Users/ajo/work/jumpstarter/contrib/drivers/shell)
+ ~ jumpstarter-driver-yepkit==0.1.0 (from file:///Users/ajo/work/jumpstarter-driver-yepkit)

Please update these lines to ensure consistency across the documentation.

🧹 Nitpick comments (9)
packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py (3)

36-36: Fix the “intefaces” spelling error.
Replace "intefaces" with "interfaces" to conform to correct spelling.

-# static shared array of usb devices, intefaces on same device cannot be claimed multiple times
+# static shared array of usb devices, interfaces on same device cannot be claimed multiple times
🧰 Tools
🪛 GitHub Check: typos

[warning] 36-36:
"intefaces" should be "interfaces".

🪛 GitHub Actions: Spell Check

[warning] 36-36: "intefaces" should be "interfaces".


[error] 36-36: intefaces should be interfaces.


67-72: Clarify device selection logic for multiple connections.
When multiple Ykush devices are present and no serial is provided, the code picks the first device found. This might lead to unpredictable device selection if multiple are connected. Consider prompting the user or raising an exception to ensure the correct device is addressed.


149-150: Finish or remove the unimplemented read method.
The read method currently raises NotImplementedError. If reading power states is not planned, consider removing this method or at least providing a stub implementation that returns a placeholder.

Would you like me to propose a basic partial implementation for read in a new comment?

packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver_test.py (1)

8-10: Add assertions to verify driver functionality.
Activating and deactivating the driver is tested, but there are no checks to confirm actual behavior. Consider adding verification steps (once read or another validation mechanism is available) to ensure the driver responds as expected.

packages/jumpstarter-driver-yepkit/examples/exporter.yaml (1)

1-27: Exporter YAML Configuration – Verify Placeholder Values and Consistency

This new configuration file clearly defines the exporter settings for the Ykush driver. The API version, kind, endpoint, and token fields are well set up. A few points to consider:

  • The token on line 4 ("<token>") is a placeholder; ensure that in production environments a valid token value is provided.
  • The export configurations for power, power2, power3, and all are consistent with our expected settings. In particular, note that only the power2 configuration includes a serial parameter. If the driver requires a serial number for correct operation in all cases (or if auto-detection is expected when omitted), please confirm this behavior.
__templates__/create_driver.sh (1)

24-24: Updated Driver Directory Naming

The assignment for DRIVER_DIRECTORY on line 24 now uses hyphenated naming (jumpstarter-driver-${DRIVER_NAME}) instead of underscores. This aligns with the new naming convention.

One minor note: the MODULE_DIRECTORY (line 25) still uses underscores (jumpstarter_driver_${DRIVER_NAME}). This difference is likely intentional since Python module names conventionally use underscores. Just ensure this mixing of naming styles is clearly documented.

docs/source/api-reference/drivers/yepkit.md (3)

11-25: Driver Configuration Example Clarity

The configuration snippet (lines 11–25) is well-formatted and provides clear examples for different export scenarios (including variations with and without the serial setting).

Ensure that the configurations here match the expectations outlined in exporter.yaml (e.g., if auto-detection for the serial number should occur when omitted, it might be worth a brief note).


26-33: Configuration Parameters Table

The table (lines 26–33) comprehensively lists the driver parameters. It might be helpful to clarify in the description for the serial field that leaving it empty triggers auto-detection if that is indeed the case.


34-43: PowerClient API Documentation

The auto-documentation block (lines 34–43) is correctly set up to document the PowerClient API. Note that a static analysis hint flagged a possible missing preposition, but the current RST directive appears standard. If you decide to refine the wording, consider reviewing the formatting of the directive options.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~43-~43: Possible missing preposition found.
Context: ... :members: on, off ### Examples Powering on and off a device{testcode} clien...

(AI_HYDRA_LEO_MISSING_OF)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4049bf8 and 1710627.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • CONTRIB.md (1 hunks)
  • __templates__/create_driver.sh (2 hunks)
  • docs/source/api-reference/drivers/yepkit.md (1 hunks)
  • packages/jumpstarter-driver-yepkit/README.md (1 hunks)
  • packages/jumpstarter-driver-yepkit/examples/exporter.yaml (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/conftest.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver_test.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/pyproject.toml (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/jumpstarter-driver-yepkit/README.md
  • packages/jumpstarter-driver-yepkit/pyproject.toml
🧰 Additional context used
🪛 LanguageTool
docs/source/api-reference/drivers/yepkit.md

[uncategorized] ~43-~43: Possible missing preposition found.
Context: ... :members: on, off ### Examples Powering on and off a device{testcode} clien...

(AI_HYDRA_LEO_MISSING_OF)

🪛 GitHub Check: typos
packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py

[warning] 36-36:
"intefaces" should be "interfaces".

🪛 GitHub Actions: Spell Check
packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py

[warning] 36-36: "intefaces" should be "interfaces".


[error] 36-36: intefaces should be interfaces.

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: pytest-matrix (3.13)
  • GitHub Check: pytest-matrix (3.12)
  • GitHub Check: e2e
🔇 Additional comments (7)
packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/conftest.py (1)

5-13: Graceful skip logic looks good!
The approach to skip tests when the hardware or backend is unavailable is clean and straightforward.

__templates__/create_driver.sh (2)

33-33: Consolidated Template File Paths in Module Loop

The template file path on line 33 has been updated to use the consolidated __templates__ directory (__templates__/driver/jumpstarter_driver/${f}.tmpl). This change simplifies the path and is consistent with our new directory structure.


38-38: Streamlined Template File Paths for Additional Files

Similarly, the template path on line 38 in the second loop now points to __templates__/driver/${f}.tmpl, which is in line with the new reorganization of the template files.

docs/source/api-reference/drivers/yepkit.md (2)

1-10: Driver Introduction and Overview Documentation

The introduction (lines 1–10) effectively presents the Yepkit (Ykush) driver, including a clear header and a brief product description with a relevant link to the Ykush USB switch.


44-75: CLI Examples and Usage Instructions

The CLI access section (lines 44–75) offers practical examples for interacting with the driver. The provided command outputs (warning and info messages) appear realistic; however, verify that the messages will match the final driver behavior. For instance, double-check whether the sample output in the CLI snippet reflects the correct state transitions (ON/OFF messages) as intended.

CONTRIB.md (2)

16-18: Updated Driver Scaffold Creation Command

The instructions for creating a new driver scaffold now correctly use the new parameters:

$ ./__templates__/create_driver.sh yepkit Ykush "Miguel Angel Ajo" "[email protected]"

This update aligns with the rebranding effort for the Yepkit driver.


19-27: New File Creaton Output Verification

The output lines (19–27) accurately show the creation of all required files in the new directory structure (packages/jumpstarter_driver_yepkit/...). This reflects the changes in the directory layout.

@mangelajo mangelajo force-pushed the yepkit-ykush-driver branch 2 times, most recently from fb9161d to f6a6645 Compare February 4, 2025 12:47
Copy link
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.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.

Actionable comments posted: 1

🧹 Nitpick comments (4)
packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py (4)

36-38: Fix typo in comment.

The comment contains a typo: "intefaces" should be "interfaces".

-# static shared array of usb devices, intefaces on same device cannot be claimed multiple times
+# static shared array of usb devices, interfaces on same device cannot be claimed multiple times
🧰 Tools
🪛 GitHub Check: typos

[warning] 36-36:
"intefaces" should be "interfaces".

🪛 GitHub Actions: Spell Check

[warning] 36-36: "intefaces" should be "interfaces".


[error] 36-36: intefaces should be interfaces.


54-90: Consider enhancing error handling.

While the error handling is generally good, consider adding more specific error types and handling USB-related exceptions that might occur during device discovery.

+from usb.core import USBError
+
 def __post_init__(self):
     if hasattr(super(), "__post_init__"):
         super().__post_init__()
@@ -75,16 +77,20 @@
             self.dev = _USB_DEVS[self.serial]
             return

-        for dev in usb.core.find(idVendor=VID, idProduct=PID, find_all=True):
-            serial = usb.util.get_string(dev, dev.iSerialNumber, 0)
-            if serial == self.serial or self.serial is None:
-                _USB_DEVS[serial] = dev
-                if self.serial is None:
-                    self.logger.warning(
-                        f"No serial number provided for ykush, using the first one found: {serial}")
-                self.serial = serial
-                self.dev = dev
-                return
+        try:
+            for dev in usb.core.find(idVendor=VID, idProduct=PID, find_all=True):
+                try:
+                    serial = usb.util.get_string(dev, dev.iSerialNumber, 0)
+                    if serial == self.serial or self.serial is None:
+                        _USB_DEVS[serial] = dev
+                        if self.serial is None:
+                            self.logger.warning(
+                                f"No serial number provided for ykush, using the first one found: {serial}")
+                        self.serial = serial
+                        self.dev = dev
+                        return
+                except USBError as e:
+                    self.logger.warning(f"Failed to get serial number from device: {e}")
+        except USBError as e:
+            raise RuntimeError(f"Failed to enumerate USB devices: {e}") from e

         raise FileNotFoundError("failed to find ykush device")

91-126: Consider parameterizing USB timeout and improving error handling.

The USB timeout is hardcoded and error handling could be more robust.

+    USB_TIMEOUT_MS = 2000  # Class constant for USB timeout
+
     def _send_cmd(self, cmd, report_size=64):
-        out_ep, in_ep = self._get_endpoints(self.dev)
-        out_buf = [0x00] * report_size
-        out_buf[0] = cmd    # YKUSH command
+        try:
+            out_ep, in_ep = self._get_endpoints(self.dev)
+            out_buf = [0x00] * report_size
+            out_buf[0] = cmd    # YKUSH command

-        # Write to the OUT endpoint
-        out_ep.write(out_buf)
+            # Write to the OUT endpoint
+            out_ep.write(out_buf)

-        # Read from the IN endpoint
-        in_buf = in_ep.read(report_size, timeout=2000)
-        return list(in_buf)
+            # Read from the IN endpoint
+            in_buf = in_ep.read(report_size, timeout=self.USB_TIMEOUT_MS)
+            return list(in_buf)
+        except USBError as e:
+            raise RuntimeError(f"Failed to send command to device: {e}") from e

148-151: Document power reading limitation.

Since power readings are not supported, consider adding a more descriptive error message explaining why.

     @export
     def read(self) -> AsyncGenerator[PowerReading, None]:
-        raise NotImplementedError
+        raise NotImplementedError("Power readings are not supported by the Ykush device")
🛑 Comments failed to post (1)
packages/jumpstarter-driver-yepkit/README.md (1)

1-1: ⚠️ Potential issue

Complete the README header.

The header appears to be incomplete. Consider updating it to properly describe the driver.

-# Jumpstarter Driver for ...
+# Jumpstarter Driver for Yepkit Ykush USB Hub
📝 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.

-# Jumpstarter Driver for ...
+# Jumpstarter Driver for Yepkit Ykush USB Hub
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

1-1: Trailing punctuation in heading
Punctuation: ' ...'

(MD026, no-trailing-punctuation)

@mangelajo mangelajo requested review from bennyz and NickCao February 4, 2025 20:28
@mangelajo mangelajo force-pushed the yepkit-ykush-driver branch from f6a6645 to be1e70b Compare February 6, 2025 10:01
@mangelajo mangelajo requested a review from NickCao February 6, 2025 10:02
@mangelajo
Copy link
Member Author

Updated :)

Copy link
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 (2)
packages/jumpstarter-driver-yepkit/examples/exporter.yaml (1)

8-30: Well-structured exporter configuration
The export mappings for power, power2, power3, and all are clearly defined and correctly reference the jumpstarter_driver_yepkit.driver.Ykush driver type. Note that the serial field is provided only for the power2 configuration. If this omission for the other entries is intentional (to use auto-detection, for example), it may help to add a comment or documentation note clarifying this behavior.

docs/source/api-reference/drivers/yepkit.md (1)

34-42: Effective PowerClient API documentation
The section describing the PowerClient API is succinct and leverages the reStructuredText directive (autoclass) to automatically generate documentation for the on and off methods. Although a static analysis hint flagged a possible missing preposition, it appears to be a false positive linked to this directive block.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fb9161d and be1e70b.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • CONTRIB.md (1 hunks)
  • __templates__/create_driver.sh (2 hunks)
  • docs/source/api-reference/drivers/yepkit.md (1 hunks)
  • packages/jumpstarter-driver-yepkit/README.md (1 hunks)
  • packages/jumpstarter-driver-yepkit/examples/exporter.yaml (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/conftest.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver_test.py (1 hunks)
  • packages/jumpstarter-driver-yepkit/pyproject.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver_test.py
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/conftest.py
  • packages/jumpstarter-driver-yepkit/README.md
  • templates/create_driver.sh
  • packages/jumpstarter-driver-yepkit/pyproject.toml
  • packages/jumpstarter-driver-yepkit/jumpstarter_driver_yepkit/driver.py
  • CONTRIB.md
🧰 Additional context used
🪛 LanguageTool
docs/source/api-reference/drivers/yepkit.md

[uncategorized] ~43-~43: Possible missing preposition found.
Context: ... :members: on, off ### Examples Powering on and off a device{testcode} clien...

(AI_HYDRA_LEO_MISSING_OF)

🔇 Additional comments (6)
packages/jumpstarter-driver-yepkit/examples/exporter.yaml (1)

1-7: Clear configuration metadata and API version
The metadata section, including the API version (jumpstarter.dev/v1alpha1), kind, and metadata (name and namespace), is clearly defined. The endpoint and token fields are provided appropriately—with the token as a placeholder—which makes it easy to adapt for real deployments.

docs/source/api-reference/drivers/yepkit.md (5)

1-9: Concise introduction and driver overview
The introduction clearly presents the Yepkit driver, specifying its association with the Ykush USB switch and the driver class (jumpstarter_driver_yepkit.driver.Ykush). The content is clear and sets the stage for the configuration details that follow.


10-25: Clear driver configuration example with minor discrepancy
The YAML configuration sample is well-documented and serves as a useful guide for users setting up the driver. One minor point: in this sample, the serial field is provided for both power and power2, whereas in the corresponding exporter configuration file, the power entry omits the serial. Please verify that this discrepancy is intentional (to demonstrate both auto-detection and explicit configuration) and, if so, consider clarifying this in the documentation.


26-32: Well-documented configuration parameters
The parameters table clearly lists the available configuration options with their descriptions, types, and required status. It might be beneficial to include an example default value in the “Default” column where applicable, but overall the table is informative and easy to follow.


43-50: Clear usage example for power control
The provided test code snippet clearly demonstrates how to use the PowerClient methods (on and off) with an appropriate delay. This serves as a practical example for users and reinforces the documentation's intent.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~43-~43: Possible missing preposition found.
Context: ... :members: on, off ### Examples Powering on and off a device{testcode} clien...

(AI_HYDRA_LEO_MISSING_OF)


51-74: Informative CLI access documentation with a potential naming consideration
The CLI instructions and sample outputs effectively guide the user through running the exporter, including both the configuration file path and sample log messages. However, note that the CLI command still references shell (i.e., jmp exporter shell), while the overall PR objective mentioned rebranding to the Yepkit driver. Please verify if the CLI command should be updated to reflect the new driver name or if shell remains valid in this context.

This USB Hub enables power control of the ports, making it useful
to control the power of different targets as long as those targets
can be USB powered.
@mangelajo mangelajo force-pushed the yepkit-ykush-driver branch from be1e70b to f933e09 Compare February 6, 2025 10:29
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