Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/iotcli/cli/commands/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ def control(ctx, action, device_name, value):
"""Control a device: on, off, status, set property=value."""
out = Output(ctx.obj["json_output"])
cfg: ConfigManager = ctx.obj["config"]
ctrl = DeviceController(verbose=ctx.obj["verbose"], debug=ctx.obj["debug"])

device = cfg.get_device_or_none(device_name)
device = cfg.get_device_or_none(device_name)
if not device:
out.error(f"Device not found: {device_name}")
return
ctrl = DeviceController(verbose=ctx.obj["verbose"], debug=ctx.obj["debug"])

try:
if action == "on":
Expand Down
1 change: 0 additions & 1 deletion src/iotcli/skills/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def build_device_context(device: Device) -> dict[str, Any]:
"petfeeder": [
"`on` triggers exactly **one quick portion** — it does NOT let you choose the amount.",
"To dispense a specific amount use `set \"portions=N\"` (N = 1–10). This is the correct command for scheduled or on-demand feeding.",
"To dispense a specific amount use `set \"portions=N\"` (N = 1–60). This is the correct command for scheduled or on-demand feeding.",
"Always query status first to check `food_level` before feeding — dispense may fail silently if the hopper is empty.",
],
"airfryer": [
Expand Down
2 changes: 2 additions & 0 deletions tests/test_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import json
import pytest

pytest.importorskip("mcp")

from iotcli.config.manager import ConfigManager
from iotcli.core.device import Device, DeviceStatus
from iotcli.mcp.tools import list_tools, handle_tool
Expand Down
Loading