local device = {} device.model = "TS0601_light" device.vendor = "Tuya" device.description = "Light" device.exposes = { { type = "light", features = { { type = "binary", name = "state", property = "state", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of this light", }, { type = "numeric", name = "brightness", property = "brightness", access = 3, min = 0, max = 254, description = "Brightness of this light", }, }, }, { type = "enum", name = "power_on_behavior", property = "power_on_behavior", access = 3, description = "Controls the behavior when the device is powered on after power loss", category = "config", values = { "off", "previous", "on" }, }, } device.tuyaDatapoints = { { dp = 1, name = "state", converter = "onOff" }, { dp = 2, name = "power_on_behavior", converter = "powerOnBehavior" }, { dp = 3, name = "brightness", converter = "scale0_254to0_1000" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_86nbew0j", }, { model = "TS0601", manufacturer = "_TZE200_io0zdqh1", }, { model = "TS0601", manufacturer = "_TZE200_drs6j6m5", }, { model = "TS0601", manufacturer = "_TZE200_ywe90lt0", }, { model = "TS0601", manufacturer = "_TZE200_qyss8gjy", }, } return device