Skip to content

TagoTiP service for sending device commands - #67

Merged
FabianoEger merged 1 commit into
mainfrom
feat/tagotip-service
Aug 18, 2026
Merged

TagoTiP service for sending device commands#67
FabianoEger merged 1 commit into
mainfrom
feat/tagotip-service

Conversation

@RicardoStoklosa

Copy link
Copy Markdown
Member

Summary

Add a TagoTiP service that sends device commands through TagoTiP. Exposed as services.tagotip.cmd({serial, protocol, body}), it wraps POST /tip/cmd using a Service Authorization token from the module token. Ports tago-io/sdk-js#184 to the Python SDK.

Test plan

  • Unit test in tests/Services/test_tagotip.py (mocked request body and response)
  • uv run pytest tests/ passes (211 tests)
  • uv run ruff check and ruff format --check pass
  • Manual: ran services.tagotip.cmd({"serial": "mqtt1", "protocol": "mqtt", "body": "reboot-now"}) against the production API, response Command sent

Risk (CIA)

Likelihood: 🟢 Low | Impact: 🟢 Low | Exposure: 🟢 Low
Additive change; new service method, no existing behavior touched.

Wrap POST /tip/cmd behind services.tagotip.cmd({serial, protocol, body}) using a Service Authorization token.
@FabianoEger
FabianoEger self-requested a review August 18, 2026 13:27

@FabianoEger FabianoEger left a comment

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.

Approve
Clean port of the JS TagoTiP service; request shape, token note, and test match the API.

In this PR

Improvements

  • docs/source/Services/index.rst:200: add a blank line before the TagoTiP heading. Every other service section has one; without it RST treats the underline as a transition and may warn on the docs build.
  • src/tagoio_sdk/modules/Services/TagoTiP.py:11: protocol is a free str, while POST /tip/cmd only accepts mqtt. Consider Literal["mqtt"] so a bad protocol fails at type-check time. Leave it as str if you want the same surface as sdk-js.

Praise

  • services.tagotip.cmd matches the JS name, and the body is rebuilt from the API fields instead of forwarding the whole dict.
  • The unit test checks both the POST payload and the unwrapped result. This repo had no Services tests before.

Risk (CIA)

Likelihood: 🟢 Low | Impact: 🟢 Low | Exposure: 🟢 Low.
Confirmed.


Outside this PR

Pre-existing

  • src/tagoio_sdk/__init__.py:1: __version__ is still 4.1.1 while pyproject.toml is 5.1.5. The User-Agent string reads __version__, so published wheels report the old number. Worth a follow-up.

@FabianoEger
FabianoEger merged commit 38953e6 into main Aug 18, 2026
6 checks passed
@FabianoEger
FabianoEger deleted the feat/tagotip-service branch August 18, 2026 13:37
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