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 giot.switch.v51ksm #1566

Open
darkaccount opened this issue Feb 12, 2025 · 0 comments
Open

Add support giot.switch.v51ksm #1566

darkaccount opened this issue Feb 12, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@darkaccount
Copy link

Device: One-Button Switch (Mesh) V5
Model: giot.switch.v51ksm
More Information:
https://home.miot-spec.com/spec/giot.switch.v51ksm

from custom_components.xiaomi_gateway3.core.devices import *


DEVICES = [{
    13138: ["GranwinIoT", "One-Button Switch (Mesh) V5", "giot.switch.v51ksm"],
    "spec": [
        BaseConv("switch", "switch", mi="2.p.1"),
        BaseConv("action", "sensor"),
        ConstConv("action", mi="2.e.1", value=BUTTON_SINGLE),
        MapConv("mode", "select", mi="2.p.2", map={0: "Wired And Wireless", 1: "Wireless", 2: "Smart Switch Mode", 3: "Toggle Switch Mode"}),
        MapConv("power_on_state", "select", mi="2.p.3", map={0: "Off", 1: "On", 2: "Default"}),
        MapConv("led_mode_normal", "select", mi="6.p.1", map={0: "Follow Switch State", 1: "Opposite To Switch State", 2: "Often Out State", 3: "Normally On State"}, entity=ENTITY_CONFIG), 
        BaseConv("backlight", "switch", mi="6.p.3"),
        BoolConv("black_led_valid", "binary_sensor", mi="6.p.4"),
        BaseConv("switch_sensor_on", "switch", mi="11.p.1"),
        MathConv("switch_sensor_mode", "number", mi="11.p.2", min=1, max=7200),
    ],
}] + DEVICES

@AlexxIT AlexxIT added the enhancement New feature or request label Feb 12, 2025
@AlexxIT AlexxIT self-assigned this Feb 12, 2025
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