mirror of
https://github.com/esphome/esphome.git
synced 2026-06-02 02:31:14 +08:00
Add additional compile time tests for canbus (#11789)
This commit is contained in:
@@ -37,6 +37,15 @@ canbus:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
number:
|
||||||
|
- platform: template
|
||||||
|
name: "Test Number"
|
||||||
|
id: test_number
|
||||||
|
optimistic: true
|
||||||
|
min_value: 0
|
||||||
|
max_value: 255
|
||||||
|
step: 1
|
||||||
|
|
||||||
button:
|
button:
|
||||||
- platform: template
|
- platform: template
|
||||||
name: Canbus Actions
|
name: Canbus Actions
|
||||||
@@ -44,3 +53,7 @@ button:
|
|||||||
- canbus.send: "abc"
|
- canbus.send: "abc"
|
||||||
- canbus.send: [0, 1, 2]
|
- canbus.send: [0, 1, 2]
|
||||||
- canbus.send: !lambda return {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};
|
||||||
|
|||||||
Reference in New Issue
Block a user