- 积分
- 470
- 金钱
- 405
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 470
- 金钱
- 405
- HASS币
- 0
|
发表于 2024-11-12 13:32:06
来自手机
|
显示全部楼层
本帖最后由 joylin1988 于 2024-11-12 15:29 编辑
手动接入,全功能
以下代码写入xiaomi_gateway3
from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
15365: [None, "Mesh Ceiling Fan Light", "Mesh Fan Light Series V1"],
"spec": [
BaseConv("照明开关", "light", mi="2.p.1"),
BrightnessConv("brightness", mi="2.p.2", max=100),
ColorTempKelvin("color_temp", mi="2.p.3", mink=2700, maxk=6500),
MapConv("灯光模式", "select", mi="2.p.5", map={0: "默认", 1: "照明", 2: "电视", 3: "温暖", 4: "阅读", 5: "睡眠", 6: "进餐", 7: "烛光", 8: "回家", 9: "离家"}),
BaseConv("风扇开关", "switch", mi="5.p.1"),
BaseConv("摇头", "switch", mi="5.p.3"),
BaseConv("反转", "switch", mi="5.p.4"),
MapConv("风扇模式", "select", mi="5.p.5", map={0: "直吹风", 1: "自然风"}),
MapConv("风速等级", "select", mi="5.p.2", map={1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6"}),
],
}] + DEVICES
HA里面功能如图,跟米家功能里一样
|
|