返回顶部
c

control-ikea-lightbulb控制宜家灯泡

Control IKEA/TP-Link Kasa smart bulbs (set on/off, brightness, and color). Use when you want to programmatically control a local smart bulb by IP on the LAN.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
1,726
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

control-ikea-lightbulb

control-ikea-lightbulb

本技能提供了一个轻量级Python脚本,用于控制本地智能灯泡(通过python-kasa支持兼容TP-Link Kasa的灯泡)。它适用于不需要云凭证的本地局域网设备;通过IP地址进行控制。

何时使用本技能

  • - 当您想要打开或关闭灯泡时
  • 当您想要设置亮度(0-100)时
  • 当您想要设置颜色(HSV)时
  • 当您拥有灯泡的本地IP且本机可访问时

内容

  • - scripts/controlkasalight.py — 主运行脚本(Python 3.9+)
  • scripts/light_show.py — 用于序列的小型灯光秀控制器(使用python-kasa)。变更包括:

- 默认白色使用高色温(9000K)使白色显得更白;传递--white-temp可覆盖。
- 错误修复:蓝色→红色之间的关闭闪烁现在忽略过渡到白色(饱和度==0)以避免白色<->蓝色乒乓效应,且white-temp仅应用于白色步骤(修复了关闭闪烁期间红色被跳过的问题)。白色步骤即使没有--double-write也会设置亮度。
  • - scripts/runtestlightshow.sh — 通过uv运行lightshow的辅助脚本

注意事项

  • - 本仓库设置为使用uv(无需手动激活环境)。依赖项位于pyproject.toml中,包装脚本优先使用uv run。

示例:
uv run --project ./skills/control-ikea-lightbulb python ./skills/control-ikea-lightbulb/scripts/controlkasalight.py --ip 192.168.4.69 --on --hsv 0 100 80 --brightness 80
  • - 安装uv:

- brew install uv(macOS)
- pipx install uv(跨平台)
  • - 提供的包装脚本需要uv:

./skills/control-ikea-lightbulb/scripts/runcontrolkasa.sh --ip 192.168.4.69 --on --hsv 0 100 80 --brightness 80
  • - 测试辅助脚本也优先使用uv:

./skills/control-ikea-lightbulb/scripts/runtestlight_show.sh --ip 192.168.4.69 --duration 6 --transition 1 --off-flash --verbose
  • - 如果您的设备实际上是IKEA TRADFRI设备(而非Kasa),此脚本可作为起点;请告知我,我将添加TRADFRI支持。
  • 无需云凭证;通过局域网控制设备IP。

快速开始

  1. 1. 安装uv(macOS):

brew install uv
  1. 2. 打开灯泡(替换IP):

./skills/control-ikea-lightbulb/scripts/runcontrolkasa.sh --ip 192.168.4.69 --on
  1. 3. 设置颜色和亮度:

./skills/control-ikea-lightbulb/scripts/runcontrolkasa.sh --ip 192.168.4.69 --hsv 0 100 80 --brightness 80

Git说明

  • - 不跟踪本地环境工件;请使用uv。

关于Python要求和近期变更的说明

  • - 本技能之前声明了python-kasa>=0.13.0,导致本机依赖解析失败。为使技能可在本地运行,项目的pyproject.toml已调整为:

- requires-python = >=3.11, <4.0
- python-kasa>=0.10.2
  • - 这使得解析器能够在Python 3.11+的机器上选择兼容的python-kasa。如果您偏好不同的约束(或希望我恢复此变更),请告知我,我将相应更新pyproject.toml和README。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 control-ikea-lightbulb-1776363508 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 control-ikea-lightbulb-1776363508 技能

通过命令行安装

skillhub install control-ikea-lightbulb-1776363508

下载

⬇ 下载 control-ikea-lightbulb v1.0.1(免费)

文件大小: 10.27 KB | 发布时间: 2026-4-17 13:49

v1.0.1 最新 2026-4-17 13:49
**Switched to uv for dependency management and simplified setup.**

- Removed the custom virtualenv bootstrap script; now uses uv and pyproject.toml for managing dependencies.
- Added pyproject.toml with updated Python and python-kasa version constraints to address resolver issues.
- Updated wrapper and helper scripts to use uv instead of manual virtualenv activation.
- Updated documentation to reflect the new uv-based workflow, with quick start instructions.
- Dropped mention of the old virtualenv in favor of uv; Git ignore advice simplified.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部