From 0feb27057b965be6f711642a80e76da4b3f6c6df Mon Sep 17 00:00:00 2001 From: Flo Date: Sat, 15 Nov 2025 17:44:42 +0100 Subject: [PATCH 1/2] Add lambda function for network component availability Added a lambda function to check network component availability. --- content/components/network.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/content/components/network.md b/content/components/network.md index f1b0dafc14..378a0bf180 100644 --- a/content/components/network.md +++ b/content/components/network.md @@ -51,6 +51,27 @@ The optimization level depends on whether PSRAM is guaranteed to be available (c > This has various security and privacy implications decribed in [RFC7721](https://datatracker.ietf.org/doc/rfc7721/), as this might leak outside of the smart home network and makes the device uniquely identifiable. > Therefore, the address generation does not comply to [RFC7217](https://datatracker.ietf.org/doc/rfc7217/). +## Lambda: Check if any network component is available + +This function is more useful for developing external components, such as a status indicator. + +```yaml +network: + id: network_id + +button: + id: update_now + name: "Update now" + on_press: + then: + - if: + condition: + lambda: |- + return id(network_id).is_available(); + then: + - logger.log: "A Network component is available!" +``` + ## See Also - {{< docref "wifi/" >}} From 57d9b8ff175b8f0afd60ded8019d9617c4ec0518 Mon Sep 17 00:00:00 2001 From: Flo Date: Sat, 15 Nov 2025 17:56:42 +0100 Subject: [PATCH 2/2] Refactor network component documentation structure --- content/components/network.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/content/components/network.md b/content/components/network.md index 378a0bf180..651c8024ea 100644 --- a/content/components/network.md +++ b/content/components/network.md @@ -51,7 +51,9 @@ The optimization level depends on whether PSRAM is guaranteed to be available (c > This has various security and privacy implications decribed in [RFC7721](https://datatracker.ietf.org/doc/rfc7721/), as this might leak outside of the smart home network and makes the device uniquely identifiable. > Therefore, the address generation does not comply to [RFC7217](https://datatracker.ietf.org/doc/rfc7217/). -## Lambda: Check if any network component is available +## Lambda + +### Check if any network component is available This function is more useful for developing external components, such as a status indicator. @@ -60,16 +62,17 @@ network: id: network_id button: - id: update_now - name: "Update now" - on_press: - then: - - if: - condition: - lambda: |- - return id(network_id).is_available(); - then: - - logger.log: "A Network component is available!" + - platform: template + id: update_now + name: "Update now" + on_press: + then: + - if: + condition: + lambda: |- + return id(network_id).is_available(); + then: + - logger.log: "A Network component is available!" ``` ## See Also