[miio] add support for Yeelight Dual Control Module (yeelink.switch.sw1) (#9295)

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
Marcel
2020-12-08 10:03:25 -08:00
committed by GitHub
parent d451648e0e
commit 3eda5ebbc9
3 changed files with 246 additions and 0 deletions

View File

@@ -260,6 +260,7 @@ public enum MiIoDevices {
YEELIGHT_C2("yeelink.light.color2", "Yeelight Color Bulb YLDP06YL 10W", THING_TYPE_BASIC),
YEELIGHT_C3("yeelink.light.color3", "Yeelight Color Bulb YLDP02YL 9W", THING_TYPE_BASIC),
YEELIGHT_C4("yeelink.light.color4", "Yeelight Bulb YLDP13YL (8,5W)", THING_TYPE_BASIC),
YEELINK_SWITCH_SW1("yeelink.switch.sw1", "Yeelight Dual Control Module", THING_TYPE_BASIC),
YL_CEILING1("yilai.light.ceiling1", "Yeelight yilai ceiling", THING_TYPE_BASIC),
YL_CEILING2("yilai.light.ceiling2", "Yeelight yilai ceiling", THING_TYPE_BASIC),
YL_CEILING3("yilai.light.ceiling3", "Yeelight yilai ceiling", THING_TYPE_BASIC),

View File

@@ -0,0 +1,213 @@
{
"deviceMapping": {
"id": [
"yeelink.switch.sw1"
],
"propertyMethod": "get_properties",
"maxProperties": 1,
"channels": [
{
"property": "on",
"siid": 2,
"piid": 1,
"friendlyName": "First Switch - Switch Status",
"channel": "on",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"tags": [
"Switch"
]
},
{
"property": "mode",
"siid": 2,
"piid": 2,
"friendlyName": "First Switch Default - Mode",
"channel": "mode",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Off"
},
{
"value": "1",
"label": "On"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"tags": [
"Switch"
],
"readmeComment": "Value mapping [0\u003d\"Off\",1\u003d\"On\"]"
},
{
"property": "mode1",
"siid": 2,
"piid": 3,
"friendlyName": "First Switch - Delay",
"channel": "mode1",
"type": "Number",
"stateDescription": {
"minimum": -1.0,
"maximum": 43200.0,
"step": 1.0,
"pattern": "%.1f"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
],
"tags": [
"Control"
]
},
{
"property": "on1",
"siid": 3,
"piid": 1,
"friendlyName": "Second Switch - Switch Status",
"channel": "on1",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"tags": [
"Switch"
]
},
{
"property": "mode2",
"siid": 3,
"piid": 2,
"friendlyName": "Second Switch Default - Mode",
"channel": "mode2",
"type": "Number",
"stateDescription": {
"options": [
{
"value": "0",
"label": "Off"
},
{
"value": "1",
"label": "On"
}
]
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"tags": [
"Switch"
],
"readmeComment": "Value mapping [0\u003d\"Off\",1\u003d\"On\"]"
},
{
"property": "mode3",
"siid": 3,
"piid": 3,
"friendlyName": "Second Switch Service - Delay",
"channel": "mode3",
"type": "Number",
"stateDescription": {
"minimum": -1.0,
"maximum": 43200.0,
"step": 1.0,
"pattern": "%.1f"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "STRING"
}
],
"tags": [
"Control"
]
},
{
"property": "interlock",
"siid": 4,
"piid": 1,
"friendlyName": "Extension - Interlock",
"channel": "interlock",
"type": "Switch",
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "ONOFFBOOL"
}
],
"tags": [
"Switch"
]
},
{
"property": "flash",
"siid": 4,
"piid": 2,
"friendlyName": "Extension - Flash",
"channel": "flash",
"type": "Number",
"stateDescription": {
"minimum": 0.0,
"maximum": 1.0,
"step": 1.0,
"pattern": "%.0f"
},
"refresh": true,
"actions": [
{
"command": "set_properties",
"parameterType": "NUMBER"
}
],
"tags": [
"Control"
]
},
{
"property": "rc-list",
"siid": 4,
"piid": 3,
"friendlyName": "Extension - Rc List",
"channel": "rc-list",
"type": "String",
"stateDescription": {
"readOnly": true
},
"refresh": true,
"actions": []
}
],
"experimental": true
}
}