Skip to content

Commit f758fb8

Browse files
authored
Merge pull request #1615 from xeonxu/feat
Fix issues from #1612. Pull request again.
2 parents 06992ad + 16f6f67 commit f758fb8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

custom_components/xiaomi_gateway3/core/devices.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,16 @@
22002200
BaseConv("no-one-duration", "sensor", mi="2.p.1079"),
22012201
BaseConv("has-someone-duration", "sensor", mi="2.p.1080")
22022202
]
2203+
}, {
2204+
22888: ["Xiaomi", "Double Wall Button", "xiaomi.remote.mcn002"],
2205+
"spec": [
2206+
BaseConv("action", "sensor"),
2207+
MapConv("action", mi="2.e.1012.p.2", map={0: BUTTON_1_SINGLE, 1: BUTTON_2_SINGLE, 2: BUTTON_BOTH_SINGLE}),
2208+
MapConv("action", mi="2.e.1013.p.2", map={0: BUTTON_1_DOUBLE, 1: BUTTON_2_DOUBLE}),
2209+
MapConv("action", mi="2.e.1014.p.2", map={0: BUTTON_1_HOLD, 1: BUTTON_2_HOLD}),
2210+
BaseConv("battery", "sensor", mi="3.p.1003"),
2211+
ConstConv("low_bat", "sensor", mi="3.e.1001", value="low_battery"),
2212+
],
22032213
}, {
22042214
# BLE devices can be supported witout spec. New spec will be added "on the fly" when
22052215
# device sends them. But better to rewrite right spec for each device
@@ -4512,6 +4522,28 @@
45124522
ConstConv("action", mi="5.e.2", value=BUTTON_1_DOUBLE),
45134523
ConstConv("action", mi="5.e.3", value=BUTTON_1_HOLD),
45144524
],
4525+
}, {
4526+
8038: ["Panasonic", "Panasonic Ceiling Fan Light", "pmfbj.light.lz8321"],
4527+
"spec": [
4528+
BaseConv("light", "light", mi="2.p.1"),
4529+
BrightnessConv("brightness", mi="2.p.2", max=100),
4530+
ColorTempKelvin("color_temp", mi="2.p.3", mink=2700, maxk=6500),
4531+
MapConv("light_mode", "select", mi="2.p.4", map={0: "Default", 1: "Daily", 2: "Leisure", 3: "Comfortable", 4: "Night", 5: "SY"}),
4532+
BaseConv("fan", "switch", mi="3.p.1"), # uint8, config
4533+
MapConv("speed", "select", mi="3.p.2", map={1: "Level1", 2: "Level2", 3: "Level3", 4: "Level4"}), # config
4534+
BaseConv("reverse", "switch", mi="3.p.12"), # uint8, config
4535+
MapConv("switch_mode", "select", mi="4.p.1", map={1: "Mode1", 2: "Mode2"}), # config
4536+
],
4537+
}, {
4538+
22777: ["Xiaomi", "Xiaomi Smart Wall Outlet", "XMZNCZ02LM", "xiaomi.plug.mcn004"],
4539+
"spec": [
4540+
BaseConv("outlet", "switch", mi="2.p.1"),
4541+
MathConv("energy", "sensor", mi="3.p.1", multiply=1, round=2),
4542+
MathConv("power", "sensor", mi="3.p.2", round=0),
4543+
BoolConv("power_consumption_accumulation_way", "binary_sensor", mi="3.p.3"),
4544+
BoolConv("led", "switch", mi="4.p.1"), # uint8, config
4545+
MapConv("power_on_state", "select", mi="2.p.2", map={0: "Default", 1: "Off", 2: "On"}), # config
4546+
],
45154547
}, {
45164548
"default": "mesh", # default Mesh device
45174549
"spec": [

0 commit comments

Comments
 (0)