File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/main/java/io/github/hapjava Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ public synchronized void reset() {
4343 try {
4444 newServices = new ArrayList <>(2 );
4545 Collection <Service > services = accessory .getServices ();
46- if (!services .stream ().anyMatch (s -> s instanceof AccessoryInformationService )) {
46+ if (!services .stream ()
47+ .anyMatch (s -> s .getType ().equals (AccessoryInformationService .TYPE ))) {
4748 newServices .add (new AccessoryInformationService (accessory ));
4849 }
4950 for (Service service : services ) {
Original file line number Diff line number Diff line change 1414
1515/** Accessory Information service. */
1616public class AccessoryInformationService extends AbstractServiceImpl {
17+ public static final String TYPE = "0000003E-0000-1000-8000-0026BB765291" ;
1718
1819 public AccessoryInformationService (
1920 IdentifyCharacteristic identify ,
@@ -22,7 +23,7 @@ public AccessoryInformationService(
2223 NameCharacteristic name ,
2324 SerialNumberCharacteristic serialNumber ,
2425 FirmwareRevisionCharacteristic firmwareRevision ) {
25- super ("0000003E-0000-1000-8000-0026BB765291" );
26+ super (TYPE );
2627 addCharacteristic (identify );
2728 addCharacteristic (manufacturer );
2829 addCharacteristic (model );
You can’t perform that action at this time.
0 commit comments