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

Fix and add PTX AKUlt and AKPro and AIDH series switch function #1530

Open
KleinerSource opened this issue Dec 29, 2024 · 0 comments
Open

Fix and add PTX AKUlt and AKPro and AIDH series switch function #1530

KleinerSource opened this issue Dec 29, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@KleinerSource
Copy link

KleinerSource commented Dec 29, 2024

AKULT add indicator_light control keymode power_on_status
AKULT fix Virtual key event
AKPRO add indicator_light control keymode power_on_status
AKPRO fix Virtual key event
AIDH fix indicator_light

`
from custom_components.xiaomi_gateway3.core.devices import *
DEVICES = [{
19642: ["PTX", "PTX Wall Switch", "AK Ultra Mesh2.0", "090615.switch.akult1"],
"spec": [
BaseConv("Channel 1", "switch", mi="2.p.1"),
MapConv("Channel 1 Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("power_on_status", "select", mi="2.p.5", map={0: "off", 1: "on", 2: "memory"}, entity=ENTITY_CONFIG),
MapConv("key_mode", "select", mi="12.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene", 4: "Interlock", 5: "Curtain"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="16.p.1", entity=ENTITY_CONFIG),
MapConv("backlight_level", "select", mi="16.p.2", map={0: "Level 0", 1: "Level 1", 2: "Level 2"}, entity=ENTITY_CONFIG),
MapConv("backlight_mode", "select", mi="16.p.3", map={0: "Default", 1: "auto", 2: "Not-disturb"}, entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="3.e.1", value=BUTTON_SINGLE),
ConstConv("action", mi="3.e.2", value=BUTTON_HOLD),
],
}, {
19641: ["PTX", "PTX Wall Switch", "AK Ultra Mesh2.0", "090615.switch.akult2"],
"spec": [
BaseConv("Channel 1", "switch", mi="2.p.1"),
BaseConv("Channel 2", "switch", mi="3.p.1"),
MapConv("Channel 1 Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 2 Mode", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("power_on_status", "select", mi="2.p.5", map={0: "off", 1: "on", 2: "memory"}, entity=ENTITY_CONFIG),
MapConv("key_1_mode", "select", mi="12.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene", 4: "Interlock", 5: "Curtain"}, entity=ENTITY_CONFIG),
MapConv("key_2_mode", "select", mi="13.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene", 4: "Interlock", 5: "Curtain"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="16.p.1", entity=ENTITY_CONFIG),
MapConv("backlight_level", "select", mi="16.p.2", map={0: "Level 0", 1: "Level 1", 2: "Level 2"}, entity=ENTITY_CONFIG),
MapConv("backlight_mode", "select", mi="16.p.3", map={0: "Default", 1: "auto", 2: "Not-disturb"}, entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="4.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="4.e.2", value=BUTTON_1_HOLD),
ConstConv("action", mi="5.e.1", value=BUTTON_2_SINGLE),
ConstConv("action", mi="5.e.2", value=BUTTON_2_HOLD),
],
}, {
19640: ["PTX", "PTX Wall Switch", "AK Ultra Mesh2.0", "090615.switch.akult3"],
"spec": [
BaseConv("Channel 1", "switch", mi="2.p.1"),
BaseConv("Channel 2", "switch", mi="3.p.1"),
BaseConv("Channel 3", "switch", mi="4.p.1"),
MapConv("Channel 1 Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 2 Mode", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 3 Mode", "select", mi="4.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("power_on_status", "select", mi="2.p.5", map={0: "off", 1: "on", 2: "memory"}, entity=ENTITY_CONFIG),
MapConv("key_1_mode", "select", mi="12.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene", 4: "Interlock", 5: "Curtain"}, entity=ENTITY_CONFIG),
MapConv("key_2_mode", "select", mi="13.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene", 4: "Interlock", 5: "Curtain"}, entity=ENTITY_CONFIG),
MapConv("key_3_mode", "select", mi="14.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene", 4: "Interlock", 5: "Curtain"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="16.p.1", entity=ENTITY_CONFIG),
MapConv("backlight_level", "select", mi="16.p.2", map={0: "Level 0", 1: "Level 1", 2: "Level 2"}, entity=ENTITY_CONFIG),
MapConv("backlight_mode", "select", mi="16.p.3", map={0: "Default", 1: "auto", 2: "Not-disturb"}, entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="5.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="5.e.2", value=BUTTON_1_HOLD),
ConstConv("action", mi="6.e.1", value=BUTTON_2_SINGLE),
ConstConv("action", mi="6.e.2", value=BUTTON_2_DOUBLE),
ConstConv("action", mi="6.e.2", value=BUTTON_2_HOLD),
ConstConv("action", mi="7.e.1", value=BUTTON_3_SINGLE),
ConstConv("action", mi="7.e.2", value=BUTTON_3_HOLD),
],
}, {
17943: ["PTX", "PTX Wall Switch", "AK Pro", "090615.switch.akpro1"],
"spec": [
BaseConv("Channel 1", "switch", mi="2.p.1"),
MapConv("Channel 1 Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("power_on_status", "select", mi="2.p.5", map={0: "off", 1: "memory", 2: "on"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="9.p.1", entity=ENTITY_CONFIG),
MapConv("key_mode", "select", mi="12.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene"}, entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="3.e.1", value=BUTTON_SINGLE),
ConstConv("action", mi="3.e.2", value=BUTTON_HOLD),
],
}, {
17944: ["PTX", "PTX Wall Switch", "AK Pro", "090615.switch.akpro2"],
"spec": [
BaseConv("Channel 1", "switch", mi="2.p.1"),
BaseConv("Channel 2", "switch", mi="3.p.1"),
MapConv("Channel 1 Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 2 Mode", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("power_on_status", "select", mi="2.p.5", map={0: "off", 1: "memory", 2: "on"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="9.p.1", entity=ENTITY_CONFIG),
MapConv("key_1_mode", "select", mi="12.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene"}, entity=ENTITY_CONFIG),
MapConv("key_2_mode", "select", mi="13.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene"}, entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="4.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="4.e.2", value=BUTTON_1_HOLD),
ConstConv("action", mi="5.e.1", value=BUTTON_2_SINGLE),
ConstConv("action", mi="5.e.2", value=BUTTON_2_HOLD),
],
}, {
17933: ["PTX", "PTX Wall Switch", "AK Pro", "090615.switch.akpro3"],
"spec": [
BaseConv("Channel 1", "switch", mi="2.p.1"),
BaseConv("Channel 2", "switch", mi="3.p.1"),
BaseConv("Channel 3", "switch", mi="4.p.1"),
MapConv("Channel 1 Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 2 Mode", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 3 Mode", "select", mi="4.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="9.p.1", entity=ENTITY_CONFIG),
MapConv("key_1_mode", "select", mi="12.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene"}, entity=ENTITY_CONFIG),
MapConv("key_2_mode", "select", mi="13.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene"}, entity=ENTITY_CONFIG),
MapConv("key_3_mode", "select", mi="14.p.1", map={0: "Default", 1: "Wireless", 2: "Diandong", 3: "Localscene"}, entity=ENTITY_CONFIG),
MapConv("power_on_status", "select", mi="2.p.5", map={0: "off", 1: "memory", 2: "on"}, entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="5.e.1", value=BUTTON_1_SINGLE),
ConstConv("action", mi="5.e.2", value=BUTTON_1_HOLD),
ConstConv("action", mi="6.e.1", value=BUTTON_2_SINGLE),
ConstConv("action", mi="6.e.2", value=BUTTON_2_HOLD),
ConstConv("action", mi="7.e.1", value=BUTTON_3_SINGLE),
ConstConv("action", mi="7.e.2", value=BUTTON_3_HOLD),
],
}, {
12470: ["PTX", "Mesh Single Wall Switch (no N)", "090615.switch.aidh1"],
"spec": [
BaseConv("switch", "switch", mi="2.p.1"),
MapConv("switch Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="9.p.1", entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="6.e.1", value=BUTTON_SINGLE),
],
}, {
12471: ["PTX", "Mesh Double Wall Switch (no N)", "090615.switch.aidh2"],
"spec": [
BaseConv("Channel 1", "switch", mi="2.p.1"),
BaseConv("Channel 2", "switch", mi="3.p.1"),
MapConv("Channel 1 Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 2 Mode", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="9.p.1", entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="6.e.1", value=BUTTON_SINGLE),
ConstConv("action", mi="7.e.1", value=BUTTON_SINGLE),
],
}, {
12472: ["PTX", "Mesh Three Wall Switch (no N)", "090615.switch.aidh3"],
"spec": [
BaseConv("Channel 1", "switch", mi="2.p.1"),
BaseConv("Channel 2", "switch", mi="3.p.1"),
BaseConv("Channel 3", "switch", mi="4.p.1"),
MapConv("Channel 1 Mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 2 Mode", "select", mi="3.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
MapConv("Channel 3 Mode", "select", mi="4.p.2", map={0: "Wired And Wireless", 1: "Wireless"}, entity=ENTITY_CONFIG),
BaseConv("indicator_light", "switch", mi="9.p.1", entity=ENTITY_CONFIG),
BaseConv("action", "sensor", entity=ENTITY_DISABLED),
ConstConv("action", mi="6.e.1", value=BUTTON_SINGLE),
ConstConv("action", mi="7.e.1", value=BUTTON_SINGLE),
ConstConv("action", mi="8.e.1", value=BUTTON_SINGLE),
],
}] + DEVICES

`

@AlexxIT AlexxIT added the enhancement New feature or request label Dec 29, 2024
@AlexxIT AlexxIT self-assigned this Dec 29, 2024
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