Skip to content

Commit 110a359

Browse files
author
Eugen Freiter
committed
reduce log leve. align more with OH guidance on logging
Signed-off-by: Eugen Freiter <freiter@gmx.de>
1 parent ee4fb0c commit 110a359

24 files changed

+71
-71
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.concurrent.CompletableFuture;
88

99
/**
10-
* Base interface for all Homekit Accessories. You can implement this interface directly, but most
10+
* Base interface for all HomeKit Accessories. You can implement this interface directly, but most
1111
* users will prefer to use the more full featured interfaces in {@link
1212
* io.github.hapjava.accessories} which include a default implementation of {@link #getServices()}.
1313
*
@@ -67,7 +67,7 @@ public interface HomekitAccessory {
6767

6868
/**
6969
* The collection of Services this accessory supports. Services are the primary way to interact
70-
* with the accessory via Homekit. Besides the Services offered here, the accessory will
70+
* with the accessory via HomeKit. Besides the Services offered here, the accessory will
7171
* automatically include the required information service.
7272
*
7373
* <p>This method will only be useful if you're implementing your own accessory type. For the

src/main/java/io/github/hapjava/characteristics/Characteristic.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Interface for the characteristics provided by a Service.
1010
*
11-
* <p>Characteristics are the lowest level building block of the Homekit Accessory Protocol. They
11+
* <p>Characteristics are the lowest level building block of the HomeKit Accessory Protocol. They
1212
* define variables that can be retrieved or set by the remote client. Most consumers of this
1313
* library will be better served by using one of the characteristic classes in {@link
1414
* io.github.hapjava.characteristics} when creating custom accessory types (the standard accessories
@@ -28,7 +28,7 @@ public interface Characteristic {
2828
void supplyValue(JsonObjectBuilder characteristicBuilder);
2929

3030
/**
31-
* Creates the JSON representation of the characteristic, in accordance with the Homekit Accessory
31+
* Creates the JSON representation of the characteristic, in accordance with the HomeKit Accessory
3232
* Protocol.
3333
*
3434
* @param iid The instance ID of the characteristic to be included in the serialization.

src/main/java/io/github/hapjava/characteristics/impl/base/BaseCharacteristic.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public final CompletableFuture<JsonObject> toJson(int iid) {
7777
}
7878

7979
/**
80-
* Creates the JSON serialized form of the accessory for use over the Homekit Accessory Protocol.
80+
* Creates the JSON serialized form of the accessory for use over the HomeKit Accessory Protocol.
8181
*
8282
* @param instanceId the static id of the accessory.
8383
* @return a future that will complete with the JSON builder for the object.
@@ -92,7 +92,7 @@ protected CompletableFuture<JsonObjectBuilder> makeBuilder(int instanceId) {
9292
return futureValue
9393
.exceptionally(
9494
t -> {
95-
logger.error("Could not retrieve value " + this.getClass().getName(), t);
95+
logger.warn("Could not retrieve value " + this.getClass().getName(), t);
9696
return null;
9797
})
9898
.thenApply(
@@ -126,7 +126,7 @@ public final void setValue(JsonValue jsonValue) {
126126
try {
127127
setValue(convert(jsonValue));
128128
} catch (Exception e) {
129-
logger.error("Error while setting JSON value", e);
129+
logger.warn("Error while setting JSON value", e);
130130
}
131131
}
132132

@@ -136,7 +136,7 @@ public void supplyValue(JsonObjectBuilder builder) {
136136
try {
137137
setJsonValue(builder, getValue().get());
138138
} catch (InterruptedException | ExecutionException e) {
139-
logger.error("Error retrieving value", e);
139+
logger.warn("Error retrieving value", e);
140140
setJsonValue(builder, getDefault());
141141
}
142142
}

src/main/java/io/github/hapjava/characteristics/impl/base/EnumCharacteristic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/**
1616
* Characteristic that exposes an Enum value. Enums are represented as an Integer value in the
17-
* Homekit protocol, and classes extending this one must handle the static mapping to an Integer
17+
* HomeKit protocol, and classes extending this one must handle the static mapping to an Integer
1818
* value.
1919
*
2020
* @author Andy Lintner
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/**
2-
* Contains the basic characteristic types that can be supplied over the Homekit Accessory Protocol.
2+
* Contains the basic characteristic types that can be supplied over the HomeKit Accessory Protocol.
33
*/
44
package io.github.hapjava.characteristics;

src/main/java/io/github/hapjava/server/HomekitAuthInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public interface HomekitAuthInfo {
2222
String getPin();
2323

2424
/**
25-
* A unique MAC address to be advertised with the Homekit information. This does not have to be
25+
* A unique MAC address to be advertised with the HomeKit information. This does not have to be
2626
* the MAC address of the network interface. You can generate this using {@link
2727
* HomekitServer#generateMac()}.
2828
*

src/main/java/io/github/hapjava/server/impl/HomekitRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public synchronized void reset() {
3737
newServices.add(new AccessoryInformationService(accessory));
3838
newServices.addAll(accessory.getServices());
3939
} catch (Exception e) {
40-
logger.error("Could not instantiate services for accessory " + accessory.getName(), e);
40+
logger.warn("Could not instantiate services for accessory " + accessory.getName(), e);
4141
services.put(accessory, Collections.emptyList());
4242
continue;
4343
}

src/main/java/io/github/hapjava/server/impl/HomekitRoot.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import org.slf4j.LoggerFactory;
1414

1515
/**
16-
* Provides advertising and handling for Homekit accessories. This class handles the advertising of
17-
* Homekit accessories and contains one or more accessories. When implementing a bridge accessory,
16+
* Provides advertising and handling for HomeKit accessories. This class handles the advertising of
17+
* HomeKit accessories and contains one or more accessories. When implementing a bridge accessory,
1818
* you will interact with this class directly. Instantiate it via {@link
1919
* HomekitServer#createBridge(HomekitAuthInfo, String, String, String, String, String, String)}. For
2020
* single accessories, this is composed by {@link HomekitStandaloneAccessoryServer}.
@@ -54,7 +54,7 @@ public class HomekitRoot {
5454
}
5555

5656
/**
57-
* Add an accessory to be handled and advertised by this root. Any existing Homekit connections
57+
* Add an accessory to be handled and advertised by this root. Any existing HomeKit connections
5858
* will be terminated to allow the clients to reconnect and see the updated accessory list. When
5959
* using this for a bridge, the ID of the accessory must be greater than 1, as that ID is reserved
6060
* for the Bridge itself.
@@ -77,33 +77,33 @@ public void addAccessory(HomekitAccessory accessory) {
7777
*/
7878
void addAccessorySkipRangeCheck(HomekitAccessory accessory) {
7979
this.registry.add(accessory);
80-
logger.info("Added accessory " + accessory.getName());
80+
logger.trace("Added accessory " + accessory.getName());
8181
if (started) {
8282
registry.reset();
8383
webHandler.resetConnections();
8484
}
8585
}
8686

8787
/**
88-
* Removes an accessory from being handled or advertised by this root. Any existing Homekit
88+
* Removes an accessory from being handled or advertised by this root. Any existing HomeKit
8989
* connections will be terminated to allow the clients to reconnect and see the updated accessory
9090
* list.
9191
*
9292
* @param accessory accessory to cease advertising and handling
9393
*/
9494
public void removeAccessory(HomekitAccessory accessory) {
9595
this.registry.remove(accessory);
96-
logger.info("Removed accessory " + accessory.getName());
96+
logger.trace("Removed accessory " + accessory.getName());
9797
if (started) {
9898
registry.reset();
9999
webHandler.resetConnections();
100100
}
101101
}
102102

103103
/**
104-
* Starts advertising and handling the previously added Homekit accessories. You should try to
104+
* Starts advertising and handling the previously added HomeKit accessories. You should try to
105105
* call this after you have used the {@link #addAccessory(HomekitAccessory)} method to add all the
106-
* initial accessories you plan on advertising, as any later additions will cause the Homekit
106+
* initial accessories you plan on advertising, as any later additions will cause the HomeKit
107107
* clients to reconnect.
108108
*/
109109
public void start() {
@@ -123,7 +123,7 @@ public void start() {
123123
});
124124
}
125125

126-
/** Stops advertising and handling the Homekit accessories. */
126+
/** Stops advertising and handling the HomeKit accessories. */
127127
public void stop() {
128128
advertiser.stop();
129129
webHandler.stop();

src/main/java/io/github/hapjava/server/impl/HomekitServer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.util.concurrent.ExecutionException;
1111

1212
/**
13-
* The main entry point for hap-java. Creating an instance of this class will listen for Homekit
13+
* The main entry point for hap-java. Creating an instance of this class will listen for HomeKit
1414
* connections on the supplied port. Only a single root accessory can be added for each unique
1515
* instance and port, however, that accessory may be a {@link #createBridge(HomekitAuthInfo, String,
1616
* String, String, String, String, String) bridge accessory} containing child accessories.
@@ -19,7 +19,7 @@
1919
* implementation supplied by your application. Several of the values needed for your implementation
2020
* are provided by this class, specifically {@link #generateKey() generateKey}, {@link
2121
* #generateMac() generateMac}, and {@link #generateSalt()}. It is important that you provide these
22-
* same values on each start of your application or Homekit will fail to recognize your device as
22+
* same values on each start of your application or HomeKit will fail to recognize your device as
2323
* being the same.
2424
*
2525
* @author Andy Lintner
@@ -160,7 +160,7 @@ public static String generateMac() {
160160

161161
/**
162162
* Generates a value to supply in {@link HomekitAuthInfo#getPin() HomekitAuthInfo.getPin()}. This
163-
* is used as the Pin a user enters into their Homekit device in order to confirm pairing.
163+
* is used as the Pin a user enters into their HomeKit device in order to confirm pairing.
164164
*
165165
* @return the generated Pin
166166
*/

src/main/java/io/github/hapjava/server/impl/HomekitStandaloneAccessoryServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import java.util.concurrent.ExecutionException;
1010

1111
/**
12-
* A server for exposing standalone Homekit accessory (as opposed to a Bridge accessory which
12+
* A server for exposing standalone HomeKit accessory (as opposed to a Bridge accessory which
1313
* contains multiple accessories). Each standalone accessory will have its own pairing information,
1414
* port, and pin. Instantiate this class via {@link
1515
* HomekitServer#createStandaloneAccessory(HomekitAuthInfo, HomekitAccessory)}.

0 commit comments

Comments
 (0)