[tuya] Build on_datapoint_update with build_trigger_callback (#20453)

This commit is contained in:
J. Nick Koston
2026-10-09 15:42:43 -10:00
committed by GitHub
parent bc44e8b550
commit fdc163a30d
6 changed files with 87 additions and 190 deletions
+44 -1
View File
@@ -10,7 +10,50 @@ tuya:
- sensor_datapoint: 6
datapoint_type: raw
then:
- logger.log: Datapoint 6 updated
- logger.log:
format: "Datapoint 6 updated, %u bytes"
args: [x.size()]
- sensor_datapoint: 1
then:
- logger.log:
format: "Datapoint %u updated"
args: [x.id]
- sensor_datapoint: 1
datapoint_type: bool
then:
- logger.log:
format: "Datapoint 1 is %s"
args: ['x ? "on" : "off"']
- sensor_datapoint: 3
datapoint_type: int
then:
- logger.log:
format: "Datapoint 3 is %d"
args: [x]
- sensor_datapoint: 3
datapoint_type: uint
then:
- logger.log:
format: "Datapoint 3 is %u"
args: [x]
- sensor_datapoint: 7
datapoint_type: string
then:
- logger.log:
format: "Datapoint 7 is %s"
args: [x.c_str()]
- sensor_datapoint: 8
datapoint_type: enum
then:
- logger.log:
format: "Datapoint 8 is %u"
args: [x]
- sensor_datapoint: 9
datapoint_type: bitmask
then:
- logger.log:
format: "Datapoint 9 is %u"
args: [x]
binary_sensor:
- platform: tuya