AlexxIT / XiaomiGateway3

Home Assistant custom component for control Xiaomi Multimode Gateway (aka Gateway 3), Xiaomi Multimode Gateway 2, Aqara Hub E1 on default firmwares over LAN
https://github.com/AlexxIT/Blog
MIT License
2.42k stars 340 forks source link

add three devices lemesh.light.wy0a20 ftd.light.dsplmp novo.curtain.k25 #1404

Open GavinIves opened 1 month ago

GavinIves commented 1 month ago
GavinIves commented 1 month ago

I have test next code.it works please add into project

from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{ 16697: ["LeMesh", "Scene Mesh monochrome light V2X series", "lemesh.light.wy0a20"], "spec": [ BaseConv("light", "light", mi="2.p.1"), BrightnessConv("brightness", mi="2.p.2", max=100), ColorTempKelvin("color_temp", mi="2.p.3", mink=2700, maxk=6500), MapConv("mode", "select", mi="2.p.7", map={0: "None", 4: "Sun", 5: "Moon", 7: "Warmth", 8: "Cinema", 9: "Reading", 10: "Computer", 11: "Hospitality", 12: "Entertainment", 13: "Wakeup", 14: "Dusk", 15: "Sleep", 16: "Custom1", 17: "Custom2", 18: "Custom3", 19: "Custom4"}), MapConv("power_on_state", "select", mi="2.p.9", map={0: "Default", 1: "ON", 2: "OFF"}), # config BaseConv("flex_switch", "switch", mi="2.p.12"), # uint8, config BoolConv("night_light", "switch", mi="2.p.13", entity=ENTITY_CONFIG), # config MapConv("dimming", "select", mi="5.p.2", map={0: "Gradient", 1: "Immediately"}, entity=ENTITY_CONFIG), # config ], }, { 13233: ["FTD", "Scene Mesh light V3 series", "ftd.light.dsplmp"], "spec": [ BaseConv("light", "light", mi="2.p.1"), BrightnessConv("brightness", mi="2.p.2", max=100), ColorTempKelvin("color_temp", mi="2.p.3", mink=2700, maxk=6500), MapConv("mode", "select", mi="2.p.5", map={0: "Warmth", 1: "Cinema", 2: "Reading", 3: "Night", 4: "Hospitality", 5: "Leisure", 8: "Wakeup", 7: "Sleep", 255: "Normal", 6: "Office"}), ], }, { 17048: ["NOVO", "Smart curtain", "novo.curtain.k25"], "spec": [ MapConv("motor", "cover", mi="2.p.1", map={0: "close", 1: "open", 2: "stop"}), BaseConv("position", mi="2.p.2"), MapConv("run_state", mi="2.p.4", map={0: "closing", 1: "opening", 2: "stop"}), ], }] + DEVICES