diff options
| author | diogo464 <[email protected]> | 2025-12-05 12:17:01 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-12-05 12:17:01 +0000 |
| commit | 0c86da392af50c7588b087c3f72602e8368af65e (patch) | |
| tree | 894cd2f353298b83a56cde06eafd7b1e366aa6b3 /examples/binary_sensor.rs | |
| parent | 1d2ee64d0ec917a2c2b66f8d58e1f37dd174a89d (diff) | |
reworked entity creation
Diffstat (limited to 'examples/binary_sensor.rs')
| -rw-r--r-- | examples/binary_sensor.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/binary_sensor.rs b/examples/binary_sensor.rs index 2809255..c0afa4a 100644 --- a/examples/binary_sensor.rs +++ b/examples/binary_sensor.rs | |||
| @@ -23,8 +23,13 @@ async fn main_task(spawner: Spawner) { | |||
| 23 | 23 | ||
| 24 | let sensor = device.create_binary_sensor( | 24 | let sensor = device.create_binary_sensor( |
| 25 | "binary-sensor-id", | 25 | "binary-sensor-id", |
| 26 | "Binary Sensor", | 26 | embassy_ha::BinarySensorConfig { |
| 27 | embassy_ha::constants::HA_DEVICE_CLASS_BINARY_SENSOR_SMOKE, | 27 | common: embassy_ha::EntityCommonConfig { |
| 28 | name: Some("Binary Sensor"), | ||
| 29 | ..Default::default() | ||
| 30 | }, | ||
| 31 | class: embassy_ha::BinarySensorClass::Smoke, | ||
| 32 | }, | ||
| 28 | ); | 33 | ); |
| 29 | 34 | ||
| 30 | spawner.must_spawn(binary_sensor_class(sensor)); | 35 | spawner.must_spawn(binary_sensor_class(sensor)); |
