本帖最后由 qjrxsoft 于 2024-12-11 16:45 编辑
试试这个吧,不保证能用哦
from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
# https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:remote-control:0000A021:giot-v51kwm:1
16191: ["V5", "Wireless Button", "giot.remote.v51kwm"],
"spec": [
BaseConv("action", "sensor"),
ConstConv("action", mi="2.e.1012.p.1", value=BUTTON_SINGLE),
ConstConv("action", mi="2.e.1013.p.1", value=BUTTON__DOUBLE),
ConstConv("action", mi="2.e.1014.p.1", value=BUTTON_HOLD),
BaseConv("backlight", "switch", mi="3.p.2"), # config
],
}] + DEVICES
|