chore: 提交高层 xiaomi 封装库及示例
- 新增 xiaomi/examples/ 下 8 个示例程序(用户/家庭查询、设备列表、开关/灯光/空调控制、属性订阅、高级过滤分类、SPEC 解析) - miot_client_sub.go: 重构 SubProp/SubEvent,使用 buildPropTopic/buildEventTopic 支持通配符订阅(siid/piid=0 → +),并修复锁顺序问题(将 RequestRefreshProp 移到 Lock 外) - spec_parser.go: 新增 downloadSpecFile 方法,本地 SPEC 文件缺失时自动从 miot-spec.org 下载 - ARCH_PLAN.md: 架构设计从 Proposed 更新为 Accepted(v1.0→v1.1),补充设备分类/工厂/SPEC 映射等模块设计 - xiaomi/: 新增 miot 上层强类型封装模块,包含 Client 主入口、用户/家庭/设备 API、属性读写、动作调用、订阅通知,以及 devices/ 设备控制抽象(Switch/Light/AirConditioner/Fan/Cover/Humidifier/Vacuum/WaterHeater/Thermostat)和 specs/ SPEC 查询辅助 - 更多 xiaomi 示例(风扇/窗帘/传感器控制)
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
{"type":"urn:miot-spec-v2:device:light:0000A001:yeelink-light1:1","description":"Light","services":[{"iid":1,"type":"urn:miot-spec-v2:service:device-information:00007801:yeelink-light1:1","description":"Device Information","properties":[{"iid":1,"type":"urn:miot-spec-v2:property:manufacturer:00000001:yeelink-light1:1","description":"Device Manufacturer","format":"string","access":["read"]},{"iid":2,"type":"urn:miot-spec-v2:property:model:00000002:yeelink-light1:1","description":"Device Model","format":"string","access":["read"]},{"iid":3,"type":"urn:miot-spec-v2:property:serial-number:00000003:yeelink-light1:1","description":"Device ID","format":"string","access":["read"]},{"iid":4,"type":"urn:miot-spec-v2:property:firmware-revision:00000005:yeelink-light1:1","description":"Current Firmware Version","format":"string","access":["read"]},{"iid":5,"type":"urn:miot-spec-v2:property:serial-no:000000FF:yeelink-light1:1","description":"Serial Number","format":"string","access":["read","notify"]}]},{"iid":2,"type":"urn:miot-spec-v2:service:light:00007802:yeelink-light1:1","description":"Light","properties":[{"iid":1,"type":"urn:miot-spec-v2:property:on:00000006:yeelink-light1:1","description":"Switch Status","format":"bool","access":["read","write","notify"]},{"iid":2,"type":"urn:miot-spec-v2:property:mode:00000008:yeelink-light1:1","description":"Mode","format":"uint8","access":["read","write","notify"],"value-list":[{"value":0,"description":"Auto"}]},{"iid":3,"type":"urn:miot-spec-v2:property:brightness:0000000D:yeelink-light1:1","description":"Brightness","format":"uint8","access":["read","write","notify"],"unit":"percentage","value-range":[1,100,1]},{"iid":4,"type":"urn:miot-spec-v2:property:color:0000000E:yeelink-light1:1","description":"Color","format":"uint32","access":["read","write","notify"],"unit":"rgb","value-range":[0,16777215,1]},{"iid":5,"type":"urn:miot-spec-v2:property:color-temperature:0000000F:yeelink-light1:1","description":"Color Temperature","format":"uint32","access":["read","write","notify"],"unit":"kelvin","value-range":[1000,10000,1]},{"iid":6,"type":"urn:miot-spec-v2:property:flow:00000010:yeelink-light1:1","description":"Flow","format":"uint8","access":["read","write","notify"],"value-list":[{"value":0,"description":"Auto"}]},{"iid":7,"type":"urn:miot-spec-v2:property:saturability:00000011:yeelink-light1:1","description":"Saturability","format":"uint8","access":["read","write","notify"],"unit":"percentage","value-range":[0,100,1]},{"iid":8,"type":"urn:miot-spec-v2:property:flex-switch:000000EC:yeelink-light1:1","description":"Flex Switch","format":"bool","access":["read","write","notify"]},{"iid":9,"type":"urn:miot-spec-v2:property:default-power-on-state:00000105:yeelink-light1:1","description":"Default Power On State","format":"uint8","access":["read","write","notify"],"value-list":[{"value":1,"description":"Off"}]},{"iid":10,"type":"urn:miot-spec-v2:property:wake-up-mode:00000107:yeelink-light1:1","description":"Wake Up Mode","format":"bool","access":["read","write","notify"]},{"iid":11,"type":"urn:miot-spec-v2:property:sleep-aid-mode:0000010B:yeelink-light1:1","description":"Sleep Aid Mode","format":"bool","access":["read","write","notify"]},{"iid":12,"type":"urn:miot-spec-v2:property:gradual-duration:0000010A:yeelink-light1:1","description":"Gradual Duration","format":"uint8","access":[],"unit":"minutes","value-range":[1,30,1]},{"iid":13,"type":"urn:miot-spec-v2:property:gradual-end-point-brightness:00000109:yeelink-light1:1","description":"Gradual End Point Brightness","format":"uint8","access":[],"unit":"percentage","value-range":[0,100,1]},{"iid":14,"type":"urn:miot-spec-v2:property:gradual-start-point-brightness:00000108:yeelink-light1:1","description":"Gradual Start Point Brightness","format":"uint8","access":[],"unit":"percentage","value-range":[0,100,1]},{"iid":15,"type":"urn:miot-spec-v2:property:current-color-mode:0000012F:yeelink-light1:1","description":"Current Color Mode","format":"uint8","access":["read","notify"],"value-list":[{"value":1,"description":"RGB"},{"value":2,"description":"ColorTemperature"}]}],"actions":[{"iid":1,"type":"urn:miot-spec-v2:action:toggle:00002811:yeelink-light1:1","description":"Toggle","in":[],"out":[]},{"iid":2,"type":"urn:miot-spec-v2:action:get-awake-config:00002849:yeelink-light1:1","description":"Get Awake Config","in":[],"out":[12,13,14]},{"iid":3,"type":"urn:miot-spec-v2:action:set-awake-config:0000284A:yeelink-light1:1","description":"Set Awake Config","in":[12,13,14],"out":[]},{"iid":4,"type":"urn:miot-spec-v2:action:get-asleep-config:00002847:yeelink-light1:1","description":"Get Asleep Config","in":[],"out":[12,13,14]},{"iid":5,"type":"urn:miot-spec-v2:action:set-asleep-config:00002848:yeelink-light1:1","description":"Set Asleep Config","in":[12,13,14],"out":[]}]}]}
|
||||
Reference in New Issue
Block a user