local device = {} device.model = "TS0601_switch_4_gang_2" device.vendor = "Tuya" device.description = "4 gang switch with backlight" device.exposes = { { type = "switch", endpoint = "l1", features = { { type = "binary", name = "state", property = "state_l1", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l1", }, }, }, { type = "switch", endpoint = "l2", features = { { type = "binary", name = "state", property = "state_l2", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l2", }, }, }, { type = "switch", endpoint = "l3", features = { { type = "binary", name = "state", property = "state_l3", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l3", }, }, }, { type = "switch", endpoint = "l4", features = { { type = "binary", name = "state", property = "state_l4", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l4", }, }, }, { type = "binary", name = "backlight_mode", property = "backlight_mode", access = 7, value_on = "ON", value_off = "OFF", description = "Mode of the backlight", category = "config", }, } device.tuyaDatapoints = { { dp = 1, name = "state_l1", converter = "onOff" }, { dp = 2, name = "state_l2", converter = "onOff" }, { dp = 3, name = "state_l3", converter = "onOff" }, { dp = 4, name = "state_l4", converter = "onOff" }, { dp = 7, name = "backlight_mode", converter = "onOff" }, } device.meta = { multiEndpoint = true } device.endpoint = { l1 = 1, l2 = 1, l3 = 1, l4 = 1, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_hewlydpz", }, } return device