Skip to content

Commit 3c462a5

Browse files
Add support for FilterMaintenanceAccessory
[#124](#124)
1 parent a0e0bda commit 3c462a5

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/main/java/io/github/hapjava/accessories/AirPurifierAccessory.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,8 @@ public interface AirPurifierAccessory extends HomekitAccessory {
7979
/** Unsubscribes from changes in the target state of the air purifier. */
8080
void unsubscribeTargetState();
8181

82-
/**
83-
* If a filter maintenance service is needed as a linked service to this AirPurifier, this is the
84-
* place.
85-
*
86-
* @return an instance of FilterMaintenanceAccessory, null if not needed.
87-
*/
88-
default FilterMaintenanceAccessory getFilterMaintenanceAccessory() {
89-
return null;
90-
};
91-
9282
@Override
9383
default Collection<Service> getServices() {
94-
AirPurifierService service = new AirPurifierService(this);
95-
FilterMaintenanceAccessory fmAccessory = this.getFilterMaintenanceAccessory();
96-
if (fmAccessory != null) {
97-
service.addLinkedService(fmAccessory.getPrimaryService());
98-
}
99-
return Collections.singleton(service);
84+
return Collections.singleton(new AirPurifierService(this));
10085
}
10186
}

0 commit comments

Comments
 (0)