@@ -16,18 +16,6 @@ abstract class AbstractServiceImpl implements Service {
1616 private final String type ;
1717 private final List <Characteristic > characteristics = new LinkedList <>();
1818
19- /**
20- * This constructor has been deprecated and replaced with {@link #AbstractServiceImpl(String, HomekitAccessory)}.
21- * Usages of this constructor will need to manually configure {@link Name} characteristic and
22- * {@link BatteryLevelCharacteristic} if needed.
23- *
24- * @param type unique UUID of the service. This information can be obtained from HomeKit Accessory Simulator.
25- */
26- @ Deprecated
27- public AbstractServiceImpl (String type ) {
28- this (type , null );
29- }
30-
3119 /**
3220 * <p>Creates a new instance of this class with the specified UUID and {@link HomekitAccessory}.
3321 * Download and install <i>HomeKit Accessory Simulator</i> to discover the corresponding UUID for
@@ -39,13 +27,14 @@ public AbstractServiceImpl(String type) {
3927 *
4028 * @param type unique UUID of the service. This information can be obtained from HomeKit Accessory Simulator.
4129 * @param accessory HomeKit accessory exposed as a service.
30+ * @param serviceName name of the service. This information is usually the name of the accessory.
4231 */
43- public AbstractServiceImpl (String type , HomekitAccessory accessory ) {
32+ public AbstractServiceImpl (String type , HomekitAccessory accessory , String serviceName ) {
4433 this .type = type ;
4534
4635 if (accessory != null ) {
4736 // Add name characteristic
48- addCharacteristic (new Name (accessory ));
37+ addCharacteristic (new Name (serviceName ));
4938
5039 // If battery operated accessory then add BatteryLevelCharacteristic
5140 if (accessory instanceof BatteryAccessory ) {
0 commit comments