本帖最后由 relliky 于 2024-6-16 18:41 编辑
我研究了一下,原本这个芯片是不支持这个8键功能的,只支持4键。
原本芯片只支持的是你截图里面的那一套,就是这些动作。
- access: []
description: Button Type
format: uint8
gatt-access: []
iid: 1
source: 1
type: urn:miot-spec-v2:property:button-type:0000011F:lemesh-ts10:1
value-list:
- description: Up Button
value: 1
- description: Right Button
value: 2
- description: Down Button
value: 3
- description: Left Button
value: 4
- description: Right Rotation
value: 5
- description: Left Rotation
value: 6
- description: Down Button Press Right Rotation
value: 7
- description: Down Button Press Left Rotation
value: 8
- description: Press To Turn Right
value: 9
- description: Press To Turn Left
value: 10
- description: Press To Turn Right
value: 11
- description: Press To Turn Left
value: 12
- description: Press To Turn Right
value: 13
- description: Press To Turn Left
value: 14
- access:
- notify
- read
description: Mode
format: uint8
gatt-access: []
iid: 1020
source: 1
type: urn:miot-spec-v2:property:mode:00000008:lemesh-ts10:1
value-list:
- description: Quick Single Click
value: 0
- description: Multiple Click
value: 1
- access: []
description: Rotation Amplitude
format: int8
iid: 2
source: 1
type: urn:miot-spec-v2:property:rotation-amplitude:0000011D:lemesh-ts10:1
unit: percentage
value-range:
- -100
- 100
- 1
但开发者想实现8个键的功能,原本芯片又只支持4个键,所以他就干脆不用那个上下左右4键的那个接口了,把旋转幅度这个参数用来复用来传递8个键加旋钮的状态。这就是为什么你的截图里面的英文是只能选择了上下左右4个键的动作的原因。
对于这个设备,任何时候按键或者旋钮的话,这个设备就会发送一个旋转角度状态给米家,然后米家那边再把这个旋转角度的状态附上文字告诉用户这个动作的意义。对照表如下。
MapConv("action", mi="5.e.1036.p.2", map={-11: "knob_anticlockwise_after_toggling_button_1",
-12: "knob_anticlockwise_after_toggling_button_2",
-13: "knob_anticlockwise_after_toggling_button_3",
-14: "knob_anticlockwise_after_toggling_button_4",
-15: "knob_anticlockwise_after_toggling_button_5",
-16: "knob_anticlockwise_after_toggling_button_6",
-17: "knob_anticlockwise_after_toggling_button_7",
-18: "knob_anticlockwise_after_toggling_button_8",
11: "knob_clockwise_after_toggling_button_1",
12: "knob_clockwise_after_toggling_button_2",
13: "knob_clockwise_after_toggling_button_3",
14: "knob_clockwise_after_toggling_button_4",
15: "knob_clockwise_after_toggling_button_5",
16: "knob_clockwise_after_toggling_button_6",
17: "knob_clockwise_after_toggling_button_7",
18: "knob_clockwise_after_toggling_button_8",
-21: "knob_anticlockwise_after_toggling_button_1_and_knob",
-22: "knob_anticlockwise_after_toggling_button_2_and_knob",
-23: "knob_anticlockwise_after_toggling_button_3_and_knob",
-24: "knob_anticlockwise_after_toggling_button_4_and_knob",
-25: "knob_anticlockwise_after_toggling_button_5_and_knob",
-26: "knob_anticlockwise_after_toggling_button_6_and_knob",
-27: "knob_anticlockwise_after_toggling_button_7_and_knob",
-28: "knob_anticlockwise_after_toggling_button_8_and_knob",
22: "knob_clockwise_after_toggling_button_1_and_knob",
22: "knob_clockwise_after_toggling_button_2_and_knob",
23: "knob_clockwise_after_toggling_button_3_and_knob",
24: "knob_clockwise_after_toggling_button_4_and_knob",
25: "knob_clockwise_after_toggling_button_5_and_knob",
26: "knob_clockwise_after_toggling_button_6_and_knob",
27: "knob_clockwise_after_toggling_button_7_and_knob",
28: "knob_clockwise_after_toggling_button_8_and_knob",}),
|