- 积分
- 935
- 金钱
- 757
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
高级会员
- 积分
- 935
- 金钱
- 757
- HASS币
- 0
|
楼主 |
发表于 2024-10-24 18:20:58
|
显示全部楼层
很简单呀 !
baobaobuku 说得很简单了
在config文件夹 建立个TXT文件
from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
20179: ["LeTianPai", "Presence Sensor POP", "rhj.sensor_occupy.l730a"],
"spec": [
BoolConv("occupancy", "binary_sensor", mi="2.p.1078"),
MathConv("temperature", "sensor", mi="7.p.1001", round=1),
BaseConv("humidity", "sensor", mi="7.p.1002"),
BaseConv("illuminance", "sensor", mi="2.p.1005"),
MapConv("occupancy_status", "sensor", mi="2.p.1078", map={0: "无人存在", 1: "有人存在", 2: "有人微动", 3: "有人远离", 4: "有人接近", 5: "有人静态", 6: "有人移动", 7: "有人进入"}),
# BaseConv("no-one-duration", "sensor", mi="2.p.1079"),
# BaseConv("has-someone-duration", "sensor", mi="2.p.1080"),
],
}] + DEVICES
全部copy 进去
再把文件改成xiaomi_gateway3.py 就OK了呀!!
切记 切记 切记 切记 扩展名 |
|