Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Implement TasmotaPower driver#425

Merged
NickCao merged 2 commits intomainfrom
tasmota
May 7, 2025
Merged

Implement TasmotaPower driver#425
NickCao merged 2 commits intomainfrom
tasmota

Conversation

@NickCao
Copy link
Copy Markdown
Collaborator

@NickCao NickCao commented Apr 24, 2025

Summary by CodeRabbit

  • New Features
    • Introduced support for Tasmota-compatible power switches, enabling device control via MQTT with on/off commands.
  • Documentation
    • Added a detailed README with installation, configuration, and API usage for the new driver.
    • Included the Tasmota driver in the system control drivers documentation.
  • Chores
    • Added package configuration, entry points, and workspace registration for the Tasmota driver.
  • Tests
    • Added tests validating MQTT command publishing and status updates handling for the Tasmota driver.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2025

Walkthrough

A new driver package, jumpstarter-driver-tasmota, was introduced for controlling Tasmota-compatible devices via MQTT. The update includes the driver implementation, documentation, project configuration, workspace registration, and tests. The driver exposes methods to turn devices on or off and is integrated as an entry point for the Jumpstarter framework.

Changes

File(s) Change Summary
packages/jumpstarter-driver-tasmota/README.md Added documentation describing the package, installation, usage, configuration parameters, and API reference for the new Tasmota driver.
packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py Introduced TasmotaPower driver class for MQTT-based control of Tasmota devices, with on, off, and read methods; includes MQTT connection and message handling logic.
packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py Added test function test_tasmota_power verifying MQTT command publishing and response handling of the TasmotaPower driver.
packages/jumpstarter-driver-tasmota/pyproject.toml Added project configuration, dependencies, entry point, build system settings, and test options for the new package.
pyproject.toml Registered jumpstarter-driver-tasmota as a workspace member under [tool.uv.sources] and extended typos dictionary with "mosquitto".
docs/source/reference/package-apis/drivers/index.md Updated driver documentation index to include the Tasmota driver in the list of system control drivers and toctree.
docs/source/reference/package-apis/drivers/tasmota.md Added a reference link to the Tasmota driver's README file.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Jumpstarter
    participant TasmotaPower
    participant MQTTBroker
    participant TasmotaDevice

    User->>Jumpstarter: Request power on/off
    Jumpstarter->>TasmotaPower: Call on()/off()
    TasmotaPower->>MQTTBroker: Publish "ON"/"OFF" to command topic
    MQTTBroker->>TasmotaDevice: Deliver command
    TasmotaDevice-->>MQTTBroker: Publish new status
    MQTTBroker-->>TasmotaPower: Deliver status update
    TasmotaPower->>Jumpstarter: Confirm state change
Loading

Suggested reviewers

  • mangelajo
  • raballew

Poem

In the warren where code does hop,
A Tasmota driver now joins the crop.
With MQTT it talks, so spry and keen,
Turning power on and off—so clean!
Hopping through topics, swift and bright,
This rabbit’s code brings smart delight.
🐇✨


📜 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 6a48791 and ff56007.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • docs/source/reference/package-apis/drivers/index.md (2 hunks)
  • docs/source/reference/package-apis/drivers/tasmota.md (1 hunks)
  • packages/jumpstarter-driver-tasmota/README.md (1 hunks)
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py (1 hunks)
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py (1 hunks)
  • packages/jumpstarter-driver-tasmota/pyproject.toml (1 hunks)
  • pyproject.toml (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • docs/source/reference/package-apis/drivers/tasmota.md
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/source/reference/package-apis/drivers/index.md
  • packages/jumpstarter-driver-tasmota/README.md
  • pyproject.toml
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py
  • packages/jumpstarter-driver-tasmota/pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: e2e
  • GitHub Check: pytest-matrix (3.11)
  • GitHub Check: pytest-matrix (3.13)
  • GitHub Check: pytest-matrix (3.12)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
✨ Finishing Touches
  • 📝 Generate Docstrings

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

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit ff56007
🔍 Latest deploy log https://app.netlify.com/sites/jumpstarter-docs/deploys/681ba8aafe425200095f55fa
😎 Deploy Preview https://deploy-preview-425--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment thread packages/jumpstarter-driver-tasmota/README.md
Comment thread packages/jumpstarter-driver-tasmota/README.md
Comment thread packages/jumpstarter-driver-tasmota/README.md Outdated
@NickCao NickCao marked this pull request as ready for review May 7, 2025 15:26
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: 8

🔭 Outside diff range comments (1)
packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py (1)

1-83: 🛠️ Refactor suggestion

Add del method for cleanup

The driver doesn't handle cleanup when it's destroyed. Add a __del__ method to stop the MQTT loop and disconnect from the broker.

Add a destructor method to ensure proper cleanup:

def __del__(self):
    """Cleanup MQTT client when the driver is destroyed."""
    try:
        self.mq.loop_stop()
        self.mq.disconnect()
    except:
        # Ignore errors during cleanup
        pass
♻️ Duplicate comments (1)
packages/jumpstarter-driver-tasmota/README.md (1)

18-18: Consider generalization to MQTT Power driver

There was a previous discussion about potentially generalizing this to an MQTT Power driver rather than making it Tasmota-specific.

While the response indicated uncertainty about similarity between vendors, it might be worth exploring if the current implementation could be made more generic with Tasmota as a specific implementation. This would allow for easier addition of other MQTT-based power devices in the future.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6f2d3c3 and beecdc0.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • packages/jumpstarter-driver-tasmota/README.md (1 hunks)
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py (1 hunks)
  • packages/jumpstarter-driver-tasmota/pyproject.toml (1 hunks)
  • pyproject.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: pytest-matrix (3.12)
  • GitHub Check: pytest-matrix (3.11)
  • GitHub Check: pytest-matrix (3.13)
  • GitHub Check: e2e
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (1)
pyproject.toml (1)

25-25: LGTM: New driver correctly added to workspace sources

The Tasmota driver has been properly added to the workspace sources section, maintaining alphabetical order in the list.

Comment thread packages/jumpstarter-driver-tasmota/README.md
Comment thread packages/jumpstarter-driver-tasmota/README.md
Comment thread packages/jumpstarter-driver-tasmota/README.md
Comment thread packages/jumpstarter-driver-tasmota/pyproject.toml Outdated
Comment thread packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py Outdated
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: 1

♻️ Duplicate comments (1)
packages/jumpstarter-driver-tasmota/README.md (1)

3-4: Duplicate: Enhance introduction with details and a link to Tasmota documentation.

The introduction is very brief and was flagged previously. Consider expanding on what Tasmota is, what devices are supported, and linking to the official docs for clarity.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between beecdc0 and ea346a5.

📒 Files selected for processing (3)
  • packages/jumpstarter-driver-tasmota/README.md (1 hunks)
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py (1 hunks)
  • packages/jumpstarter-driver-tasmota/pyproject.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py
  • packages/jumpstarter-driver-tasmota/pyproject.toml
🧰 Additional context used
🪛 LanguageTool
packages/jumpstarter-driver-tasmota/README.md

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...wer ``` ### Config parameters - host: MQTT broker hostname or IP address (req...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: pytest-matrix (3.12)
  • GitHub Check: pytest-matrix (3.11)
  • GitHub Check: pytest-matrix (3.13)
  • GitHub Check: e2e
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (3)
packages/jumpstarter-driver-tasmota/README.md (3)

7-9: Installation command is correct.

The pip install command includes the extra index and the package name as expected. No changes needed here.


15-19: Skip: Configuration example appears well-formed.

The YAML snippet correctly shows how to declare the TasmotaPower driver entry point. No additional comments.


21-33:

Details

✅ Verification successful

Verify that documented config parameters match the driver’s constructor.

Please ensure that each parameter name, requirement flag, and default value aligns exactly with the TasmotaPower class signature.

Run this script to extract the __init__ signature from the driver file:


🏁 Script executed:

#!/bin/bash
# Search for TasmotaPower constructor parameters
rg --context 2 "class TasmotaPower" -n packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py
rg --context 1 "def __init__" -n packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py

Length of output: 362


🏁 Script executed:

#!/bin/bash
# Extract dataclass fields for TasmotaPower to verify documented config parameters
python3 - << 'EOF'
import ast, sys
file_path = 'packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py'
try:
    with open(file_path, 'r') as f:
        tree = ast.parse(f.read(), filename=file_path)
except FileNotFoundError:
    sys.exit(f"ERROR: {file_path} not found")

for node in tree.body:
    if isinstance(node, ast.ClassDef) and node.name == 'TasmotaPower':
        print(f"Found class TasmotaPower in {file_path}\n")
        for stmt in node.body:
            # look for annotated assignments (dataclass fields)
            if isinstance(stmt, ast.AnnAssign):
                # field name
                if isinstance(stmt.target, ast.Name):
                    name = stmt.target.id
                else:
                    name = ast.unparse(stmt.target)
                # annotation
                ann = ast.unparse(stmt.annotation)
                # default value
                default = ast.unparse(stmt.value) if stmt.value is not None else "(required)"
                print(f"{name}: type={ann}, default={default}")
        sys.exit(0)
sys.exit("ERROR: TasmotaPower class not found")
EOF

Length of output: 705


Documentation matches driver constructor
Verified that each documented parameter name, requirement flag, and default value aligns exactly with the TasmotaPower dataclass fields. No changes needed.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...wer ``` ### Config parameters - host: MQTT broker hostname or IP address (req...

(UNLIKELY_OPENING_PUNCTUATION)

Comment thread packages/jumpstarter-driver-tasmota/README.md
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: 1

♻️ Duplicate comments (2)
packages/jumpstarter-driver-tasmota/README.md (2)

3-3: Enhance introduction with more details about Tasmota

The introduction is very brief and doesn't explain what Tasmota is or what specific devices/capabilities are supported.

-`jumpstarter-driver-tasmota` provides functionality for interacting with tasmota compatible devices.
+`jumpstarter-driver-tasmota` provides functionality for interacting with Tasmota-compatible power devices via MQTT. 
+[Tasmota](https://tasmota.github.io/docs/) is an open-source firmware for ESP8266/ESP32 devices that supports control 
+via MQTT. This driver allows controlling power switches flashed with Tasmota firmware.

38-42: Fix incorrect module path in API reference

The Sphinx directive references jumpstarter_driver_power.client.PowerClient(), but it should reference the correct module path for this package.

 ```{eval-rst}
-.. autoclass:: jumpstarter_driver_power.client.PowerClient()
+.. autoclass:: jumpstarter_driver_tasmota.client.PowerClient
     :no-index:
     :members: on, off

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

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

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between ea346a5293f044083d15fc6924c4f2a2bd607139 and 33a4d3f3200a0e9e8de9cfa762d2477c20c10fdf.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `uv.lock` is excluded by `!**/*.lock`

</details>

<details>
<summary>📒 Files selected for processing (7)</summary>

* `docs/source/reference/package-apis/drivers/index.md` (2 hunks)
* `docs/source/reference/package-apis/drivers/tasmota.md` (1 hunks)
* `packages/jumpstarter-driver-tasmota/README.md` (1 hunks)
* `packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py` (1 hunks)
* `packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py` (1 hunks)
* `packages/jumpstarter-driver-tasmota/pyproject.toml` (1 hunks)
* `pyproject.toml` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (3)</summary>

* docs/source/reference/package-apis/drivers/tasmota.md
* docs/source/reference/package-apis/drivers/index.md
* pyproject.toml

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* packages/jumpstarter-driver-tasmota/pyproject.toml
* packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 Ruff (0.8.2)</summary>

<details>
<summary>packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py</summary>

1-1: `pytest` imported but unused

Remove unused import: `pytest`

(F401)

</details>

</details>
<details>
<summary>🪛 GitHub Check: ruff</summary>

<details>
<summary>packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py</summary>

[failure] 1-1: Ruff (F401)
packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py:1:8: F401 `pytest` imported but unused

</details>

</details>
<details>
<summary>🪛 GitHub Check: typos</summary>

<details>
<summary>packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py</summary>

[warning] 16-16: 
"mosquitto" should be "mosquito".

---

[warning] 15-15: 
"mosquitto" should be "mosquito".

---

[warning] 9-9: 
"mosquitto" should be "mosquito".

</details>

</details>
<details>
<summary>🪛 GitHub Actions: Lint</summary>

<details>
<summary>packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py</summary>

[error] 1-1: ESLint: 'pytest' imported but unused. (F401)

</details>

</details>
<details>
<summary>🪛 GitHub Actions: Spell Check</summary>

<details>
<summary>packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py</summary>

[error] 9-9: `mosquitto` should be `mosquito` in function parameter name.

---

[error] 15-15: `mosquitto` should be `mosquito` in dictionary key access at host parameter.

---

[error] 16-16: `mosquitto` should be `mosquito` in dictionary key access at port parameter.

</details>

</details>
<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>packages/jumpstarter-driver-tasmota/README.md</summary>

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...wer ```  ### Config parameters  - `host`: MQTT broker hostname or IP address (req...

(UNLIKELY_OPENING_PUNCTUATION)

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (8)</summary>

* GitHub Check: pytest-matrix (3.12)
* GitHub Check: pytest-matrix (3.13)
* GitHub Check: pytest-matrix (3.11)
* GitHub Check: e2e
* GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
* GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
* GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
* GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)

</details>

<details>
<summary>🔇 Additional comments (4)</summary><blockquote>

<details>
<summary>packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py (4)</summary>

`8-8`: **Clarify test requirements**

The commented-out skip decorator suggests this test requires Docker. Either remove the comment if Docker is no longer required, or uncomment it if the test should be skipped in environments without Docker.


```diff
-# @pytest.mark.skip("requires docker")
+@pytest.mark.skip("requires docker")

Or:

-# @pytest.mark.skip("requires docker")

9-11: Note about "mosquitto" spelling

The pipeline is flagging "mosquitto" as a typo suggesting "mosquito", but Mosquitto is the correct name of the MQTT broker. You can add this word to your project's dictionary or ignore these specific warnings.

🧰 Tools
🪛 GitHub Check: typos

[warning] 9-9:
"mosquitto" should be "mosquito".

🪛 GitHub Actions: Spell Check

[error] 9-9: mosquitto should be mosquito in function parameter name.


23-25: Test implementation looks good

The test correctly verifies that calling the on() method publishes the expected "ON" message to the command topic.


27-29: Test implementation looks good

The test correctly verifies that calling the off() method publishes the expected "OFF" message to the command topic.

@NickCao NickCao force-pushed the tasmota branch 2 times, most recently from c687c5e to 945ce5d Compare May 7, 2025 16:52

### Config parameters

- `host`: MQTT broker hostname or IP address (required)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We normally use a table for this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@coderabbitai rewrite it into markdown table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@NickCao Here's the configuration parameters section rewritten as a markdown table:

 ### Config parameters
 
-  - `host`: MQTT broker hostname or IP address (required)
-  - `port`: MQTT broker port (default: 1883)
-  - `tls`: MQTT broker tls (default: True)
-  - `client_id`: Client identifier for MQTT connection (optional)
-  - `transport`: Transport protocol, one of "tcp", "websockets", "unix" (default: "tcp")
-  - `timeout`: Timeout in seconds for operations (optional)
-  - `username`: Username for MQTT authentication (optional)
-  - `password`: Password for MQTT authentication (optional)
-  - `cmnd_topic`: MQTT topic for sending commands to the Tasmota device (required)
-  - `stat_topic`: MQTT topic for receiving status updates from the Tasmota device (required)
+  | Parameter | Description | Default/Required |
+  |-----------|-------------|------------------|
+  | `host` | MQTT broker hostname or IP address | Required |
+  | `port` | MQTT broker port | 1883 |
+  | `tls` | MQTT broker TLS | True |
+  | `client_id` | Client identifier for MQTT connection | Optional |
+  | `transport` | Transport protocol, one of "tcp", "websockets", "unix" | "tcp" |
+  | `timeout` | Timeout in seconds for operations | Optional |
+  | `username` | Username for MQTT authentication | Optional |
+  | `password` | Password for MQTT authentication | Optional |
+  | `cmnd_topic` | MQTT topic for sending commands to the Tasmota device | Required |
+  | `stat_topic` | MQTT topic for receiving status updates from the Tasmota device | Required |

✏️ Learnings added
Learnt from: NickCao
PR: jumpstarter-dev/jumpstarter#425
File: packages/jumpstarter-driver-tasmota/README.md:23-23
Timestamp: 2025-05-07T18:33:56.869Z
Learning: In Jumpstarter documentation, configuration parameters should be presented in markdown tables rather than bulleted lists for better readability.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

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

♻️ Duplicate comments (2)
packages/jumpstarter-driver-tasmota/README.md (2)

3-3: Refine and expand the introduction.
The current intro is very brief and doesn’t explain what Tasmota is or link to its docs. Consider something like:

- `jumpstarter-driver-tasmota` provides functionality for interacting with tasmota compatible devices.
+ `jumpstarter-driver-tasmota` provides functionality for interacting with Tasmota-compatible power devices via MQTT. 
+ [Tasmota](https://tasmota.github.io/docs/) is an open-source firmware for ESP8266/ESP32 devices supporting MQTT commands. 
+ This driver enables on/off control through the Jumpstarter framework.

39-41: ⚠️ Potential issue

Fix the Sphinx API reference path.
The autoclass directive points to the wrong module (jumpstarter_driver_power). It should reference this package:

-.. autoclass:: jumpstarter_driver_power.client.PowerClient()
+.. autoclass:: jumpstarter_driver_tasmota.client.PowerClient
     :no-index:
     :members: on, off
🧹 Nitpick comments (1)
packages/jumpstarter-driver-tasmota/README.md (1)

23-33: Clarify parameter descriptions.
A couple of entries could be more precise and consistent. For example:

- `tls`: MQTT broker tls (default: True)
+ `tls`: Enable TLS encryption for the MQTT connection (default: True)

Consider grouping required vs. optional parameters or using a table for better readability.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...wer ``` ### Config parameters - host: MQTT broker hostname or IP address (req...

(UNLIKELY_OPENING_PUNCTUATION)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 33a4d3f and 6a48791.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • docs/source/reference/package-apis/drivers/index.md (2 hunks)
  • docs/source/reference/package-apis/drivers/tasmota.md (1 hunks)
  • packages/jumpstarter-driver-tasmota/README.md (1 hunks)
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py (1 hunks)
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py (1 hunks)
  • packages/jumpstarter-driver-tasmota/pyproject.toml (1 hunks)
  • pyproject.toml (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/source/reference/package-apis/drivers/tasmota.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/source/reference/package-apis/drivers/index.md
  • pyproject.toml
  • packages/jumpstarter-driver-tasmota/pyproject.toml
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver.py
  • packages/jumpstarter-driver-tasmota/jumpstarter_driver_tasmota/driver_test.py
🧰 Additional context used
🪛 LanguageTool
packages/jumpstarter-driver-tasmota/README.md

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...wer ``` ### Config parameters - host: MQTT broker hostname or IP address (req...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: pytest-matrix (3.11)
  • GitHub Check: pytest-matrix (3.13)
  • GitHub Check: pytest-matrix (3.12)
  • GitHub Check: e2e
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (2)
packages/jumpstarter-driver-tasmota/README.md (2)

7-9: Installation instructions look correct.
The pip command includes the extra-index URL and the proper package name. This will install both the driver and its paho-mqtt dependency:

pip3 install --extra-index-url https://pkg.jumpstarter.dev/simple/ jumpstarter-driver-tasmota

15-19: Configuration snippet is accurate.
Your example correctly shows how to export a power component using jumpstarter_driver_tasmota.driver.TasmotaPower. Ensure users supply all required keys (e.g., cmnd_topic, stat_topic) in their YAML.

@NickCao NickCao enabled auto-merge May 7, 2025 18:38
@NickCao NickCao merged commit fadf316 into main May 7, 2025
19 checks passed
@mangelajo mangelajo added the backport release-0.6 Backport PR to release-0.6 branch label May 8, 2025
@jumpstarter-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for release-0.6:

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

Labels

backport release-0.6 Backport PR to release-0.6 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants