From 51027d838eb4fbf298c546b163d650a5b0eb2599 Mon Sep 17 00:00:00 2001 From: diogo464 Date: Fri, 5 Dec 2025 15:23:24 +0000 Subject: removed unused comment --- src/lib.rs | 118 ------------------------------------------------------------- 1 file changed, 118 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index ac26a45..325df1d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -732,121 +732,3 @@ async fn wait_on_atomic_waker(waker: &AtomicWaker) { } F(waker, false).await } - -/* - Step-by-Step Process - - 1. What are you measuring/controlling? - - Start with the physical thing: - - "I want to measure temperature" - - "I want to detect if a door is open" - - "I want to control a relay" - - "I want a button to restart the device" - - 2. Pick the component type based on behavior - - Ask yourself: - - Is it read-only or controllable? - - Does it have numeric values or on/off states? - - Decision tree: - Read-only measurement? - ├─ Numeric value (23.5, 65%, etc.) - │ └─ Component: sensor - └─ On/off state (open/closed, detected/not detected) - └─ Component: binary_sensor - - Controllable? - ├─ On/off control - │ └─ Component: switch (or light for LEDs) - ├─ Adjustable number - │ └─ Component: number - ├─ Select from options - │ └─ Component: select - └─ Trigger action (no state) - └─ Component: button - - 3. Pick the device_class (if applicable) - - Now look at the component type you chose: - - For sensor - What kind of measurement? - - Temperature → device_class: "temperature" - - Humidity → device_class: "humidity" - - Pressure → device_class: "pressure" - - Custom metric → device_class: None - - For binary_sensor - What kind of detection? - - Door → device_class: "door" - - Motion → device_class: "motion" - - Window → device_class: "window" - - Generic → device_class: None - - For button - No device_class needed! - - 4. Pick units (if applicable) - - Based on your device_class: - - Temperature → "°C" or "°F" - - Humidity → "%" - - Pressure → "hPa" - - Examples - - Example 1: DHT22 Temperature Reading - - 1. What? → Measure temperature - 2. Component? → sensor (numeric, read-only) - 3. Device class? → "temperature" - 4. Unit? → "°C" - - Result: - - Discovery: homeassistant/sensor/pico2w_temp/config - - JSON: device_class: "temperature", unit_of_measurement: "°C" - - Example 2: Reed Switch on Door - - 1. What? → Detect door open/closed - 2. Component? → binary_sensor (on/off state, read-only) - 3. Device class? → "door" - 4. Unit? → N/A - - Result: - - Discovery: homeassistant/binary_sensor/pico2w_door/config - - JSON: device_class: "door" - - Example 3: Relay Control - - 1. What? → Control a relay - 2. Component? → switch (on/off, controllable) - 3. Device class? → None (switches typically don't have device_class) - 4. Unit? → N/A - - Result: - - Discovery: homeassistant/switch/pico2w_relay/config - - JSON: No device_class needed - - Example 4: Restart Button - - 1. What? → Trigger device restart - 2. Component? → button (action trigger, no state) - 3. Device class? → None (buttons don't have device_class) - 4. Unit? → N/A - - Result: - - Discovery: homeassistant/button/pico2w_restart/config - - JSON: No device_class, no state_topic - - TL;DR Workflow - - Physical thing - ↓ - Component type (behavior: read-only numeric? binary? controllable?) - ↓ - Device class (what specific type?) - ↓ - Units (if numeric) - - Does this mental model make sense now? -*/ -- cgit