Add additional compile time tests for canbus (#11789)

This commit is contained in:
J. Nick Koston
2025-11-09 16:09:46 -06:00
committed by GitHub
parent b49619d9bf
commit 783dbd1e6b

View File

@@ -37,6 +37,15 @@ canbus:
break;
}
number:
- platform: template
name: "Test Number"
id: test_number
optimistic: true
min_value: 0
max_value: 255
step: 1
button:
- platform: template
name: Canbus Actions
@@ -44,3 +53,7 @@ button:
- canbus.send: "abc"
- canbus.send: [0, 1, 2]
- canbus.send: !lambda return {0, 1, 2};
# Test canbus.send with lambda that references a component (function pointer)
- canbus.send: !lambda |-
uint8_t val = (uint8_t)id(test_number).state;
return std::vector<uint8_t>{0xAA, val, 0xBB};