Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support linp.curtain.c2,linp.wopener.wd2lb and update Linptech Switch QT1 #1348

Open
meineihan opened this issue May 6, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@meineihan
Copy link

meineihan commented May 6, 2024

add linp.curtain.c2,linp.wopener.wd2lb
update Linptech Switch QT1,add brightness white&orange

from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{
    10807: ["Linptech", "Linp Smart Curtain Motor", "linp.curtain.c2"],
    "spec": [
        MapConv("motor", "cover", mi="2.p.1", map={0: "stop", 1: "open", 2: "close"}),
        CurtainPosConv("position", mi="2.p.2"),
        MathConv("target-position", "number", mi="2.p.2", min=0, max=100, entity=ENTITY_CONFIG),
        BaseConv("target_position", mi="2.p.3"),
        BaseConv("motor_reverse", "switch", mi="2.p.4"),
        MapConv("mode", "select", mi="2.p.5", map={0: "default", 1: "doublmode", 2: "leftmode", 3: "rightmode"}),
    ],
    "ttl": "7d",
}, {
    13203: ["Linptech", "Casement Window Driver WD2", "linp.wopener.wd2lb"],
    "spec": [
        MapConv("motor", "cover", mi="2.p.1", map={0: "stop", 1: "open", 2: "close"}),
        CurtainPosConv("position", mi="2.p.2"),
        BaseConv("target_position", mi="2.p.3"),
        MathConv("target-position", "number", mi="2.p.3", min=0, max=100, entity=ENTITY_CONFIG),
        BaseConv("battery", "sensor", mi="3.p.1", entity=ENTITY_LAZY),
        MapConv("battery_status", "sensor", mi="3.p.3", map={0: "Idle", 1: "Adapter", 2: "Solar", 3: "Protected", 4: "Adapter-float"}),
        MapConv("anti_pinch_sensitivity", "select", mi="4.p.2", map={0: "Very_low", 1: "Low", 2: "Medium", 3:"High"}),
    ],
}, {
    15658: ["Linptech", "Single Wall Switch QT1", "linp.switch.qt1db1"],
    "spec": [
        BaseConv("switch", "switch", mi="2.p.1"),
        BoolConv("wireless", "switch", mi="2.p.2"),
        BaseConv("led", "switch", mi="11.p.1"),
        BaseConv("action", "sensor"),
        MapConv("touch", "select", mi="12.p.1", map={0: "Off", 1: "Low", 2:"Medium", 3:"High"}),
        ConstConv("action", mi="3.e.1", value=BUTTON_SINGLE),  
        MathConv("brightness_white", "number", mi="12.p.5", min=0, max=100, entity=ENTITY_CONFIG),
        MathConv("brightness_orange", "number", mi="12.p.6", min=0, max=100, entity=ENTITY_CONFIG),
    ],
}, {
    15659: ["Linptech", "Double Wall Switch QT1", "linp.switch.qt1db2"],
    "spec": [
        BaseConv("switch_1", "switch", mi="2.p.1"),
        BaseConv("switch_2", "switch", mi="3.p.1"),
        BoolConv("wireless_1", "switch", mi="2.p.2"),
        BoolConv("wireless_2", "switch", mi="3.p.2"),
        BaseConv("led", "switch", mi="11.p.1"),
        BaseConv("action", "sensor"),
        MapConv("touch", "select", mi="12.p.1", map={0: "Off", 1: "Low", 2:"Medium", 3:"High"}),
        ConstConv("action", mi="4.e.1", value=BUTTON_1_SINGLE),
        ConstConv("action", mi="5.e.1", value=BUTTON_2_SINGLE),
        MathConv("brightness_white", "number", mi="12.p.5", min=0, max=100, entity=ENTITY_CONFIG),
        MathConv("brightness_orange", "number", mi="12.p.6", min=0, max=100, entity=ENTITY_CONFIG),
    ],
}, {
    15660: ["Linptech", "Triple Wall Switch QT1", "linp.switch.qt1db3"],
    "spec": [
        BaseConv("switch_1", "switch", mi="2.p.1"),
        BaseConv("switch_2", "switch", mi="3.p.1"),
        BaseConv("switch_3", "switch", mi="4.p.1"),
        BoolConv("wireless_1", "switch", mi="2.p.2"),
        BoolConv("wireless_2", "switch", mi="3.p.2"),
        BoolConv("wireless_3", "switch", mi="4.p.2"),
        BaseConv("led", "switch", mi="11.p.1"),
        BaseConv("action", "sensor"),
        MapConv("touch", "select", mi="12.p.1", map={0: "Off", 1: "Low", 2:"Medium", 3:"High"}),
        ConstConv("action", mi="5.e.1", value=BUTTON_1_SINGLE),
        ConstConv("action", mi="6.e.1", value=BUTTON_2_SINGLE),
        ConstConv("action", mi="7.e.1", value=BUTTON_3_SINGLE),
        MathConv("brightness_white", "number", mi="12.p.5", min=0, max=100, entity=ENTITY_CONFIG),
        MathConv("brightness_orange", "number", mi="12.p.6", min=0, max=100, entity=ENTITY_CONFIG),
    ],
}, {
    15661: ["Linptech", "Quadruple Wall Switch QT1", "linp.switch.qt1db4"],
    "spec": [
        BaseConv("switch_1", "switch", mi="2.p.1"),
        BaseConv("switch_2", "switch", mi="3.p.1"),
        BaseConv("switch_3", "switch", mi="4.p.1"),
        BaseConv("switch_4", "switch", mi="5.p.1"),
        BoolConv("wireless_1", "switch", mi="2.p.2"),
        BoolConv("wireless_2", "switch", mi="3.p.2"),
        BoolConv("wireless_3", "switch", mi="4.p.2"),
        BoolConv("wireless_4", "switch", mi="5.p.2"),
        BaseConv("led", "switch", mi="11.p.1"),
        BaseConv("action", "sensor"),
        MapConv("action", mi="6.e.1.p.1", map={1: BUTTON_1_SINGLE, 2: BUTTON_2_SINGLE, 3: BUTTON_3_SINGLE, 4: BUTTON_4_SINGLE}),
        MapConv("touch", "select", mi="12.p.1", map={0: "Off", 1: "Low", 2:"Medium", 3:"High"}),
        MathConv("brightness_white", "number", mi="12.p.5", min=0, max=100, entity=ENTITY_CONFIG),
        MathConv("brightness_orange", "number", mi="12.p.6", min=0, max=100, entity=ENTITY_CONFIG),
    ],
}] + DEVICES
@meineihan meineihan changed the title add support and update add support linp.curtain.c2,linp.wopener.wd2lb and update Linptech Switch QT1 May 6, 2024
@AlexxIT AlexxIT added the enhancement New feature or request label May 6, 2024
@AlexxIT AlexxIT self-assigned this May 6, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 6, 2024

target-position and target_position - very strange

@meineihan
Copy link
Author

target-position and target_position - very strange

target-position can input the number to set the position of the curtain
But if I delete the target_position,motor cannot get the poision of the curtain,can open the cover only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants