From 99308bb97832d22acb9b0971e17a3bd0d9873267 Mon Sep 17 00:00:00 2001 From: Gregg Date: Fri, 9 Feb 2024 21:09:26 -0600 Subject: [PATCH] Update 17-LinkedServices.ino --- .../17-LinkedServices/17-LinkedServices.ino | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/examples/17-LinkedServices/17-LinkedServices.ino b/examples/17-LinkedServices/17-LinkedServices.ino index 78555d7..c9bc469 100644 --- a/examples/17-LinkedServices/17-LinkedServices.ino +++ b/examples/17-LinkedServices/17-LinkedServices.ino @@ -35,12 +35,6 @@ // // //////////////////////////////////////////////////////////// -// WARNING: THIS EXAMPLE STOPPED WORKING CORRECTLY SOMEWHERE AROUND THE IOS 15.2 OR IOS 15.3 UPDATE -// AND DOES NOT WORK AS OF IOS 15.4.1 -// -// THE PROBLEM APPEARS TO BE IN THE RENDERING OF INDIVIDUAL VALVES IN THE HOME APP INTERFACE. THEY -// APPEAR IN THE EVE HOMEKIT APPLICATION, BUT NOT APPLE'S HOME APP. - #include "HomeSpan.h" // HAP normally treats multiple Services created within the same Accessory as independent of one another. However, certain HAP Services are designed to represent a central point @@ -112,19 +106,19 @@ struct Shower : Service::Faucet { // this is our Shower structur SpanCharacteristic *active=new Characteristic::Active(); // our implementation only requires the Active Characteristic - Shower(int nHeads){ // this is the constructor for Shower. It takes a single argument that specifies the number of spray heads (WaterValves) - for(int i=0;iactive->getVal() && active->getVal() && !inUse->getVal()) // If the Shower is Active, and the Valve is Active, but InUse is NOT Active... - inUse->setVal(1); // ...set the InUse Characteristic to Active - else if(!shower->active->getVal() && inUse->getVal()) // Otherwise, if the Shower is NOT Active but InUse is Active... - inUse->setVal(0); // ...set the InUse Characteristic to NOT Active + if(shower->active->getVal() && active->getVal() && !inUse->getVal()) // If the Shower is Active, and the Valve is Active but NOT showing InUse... + inUse->setVal(1); // ...show Valve as InUse + else if(!shower->active->getVal() && inUse->getVal()) // Otherwise, if the Shower is NOT Active but Valve IS showing InUse... + inUse->setVal(0); // ...show Valve as NOT InUse } }; // WaterValve