characteristics = new LinkedList<>();
-
- /**
- * This constructor has been deprecated and replaced with
- * {@link #AbstractServiceImpl(String, HomekitAccessory, String)}. Usages of
- * this constructor will need to manually configure {@link Name} characteristic
- * and {@link BatteryLevelCharacteristic} if needed.
- *
- * @param type unique UUID of the service. This information can be obtained from HomeKit Accessory Simulator.
- */
- @Deprecated
- public AbstractServiceImpl(String type) {
- this(type, null, null);
- }
-
- /**
- * Creates a new instance of this class with the specified UUID and {@link HomekitAccessory}.
- * Download and install HomeKit Accessory Simulator to discover the corresponding UUID for
- * the specific service.
- *
- * The new service will automatically add {@link Name} characteristic. If the accessory
- * is battery operated then it must implement {@link BatteryAccessory} and {@link BatteryLevelCharacteristic}
- * will be added too.
- *
- * @param type unique UUID of the service. This information can be obtained from HomeKit Accessory Simulator.
- * @param accessory HomeKit accessory exposed as a service.
- * @param serviceName name of the service. This information is usually the name of the accessory.
- */
- public AbstractServiceImpl(String type, HomekitAccessory accessory, String serviceName) {
- this.type = type;
-
- if (accessory != null) {
- // Add name characteristic
- addCharacteristic(new Name(serviceName));
-
- // If battery operated accessory then add BatteryLevelCharacteristic
- if (accessory instanceof BatteryAccessory) {
- BatteryAccessory batteryAccessory = (BatteryAccessory) accessory;
- addCharacteristic(new BatteryLevelCharacteristic(
- batteryAccessory::getBatteryLevelState,
- batteryAccessory::subscribeBatteryLevelState,
- batteryAccessory::unsubscribeBatteryLevelState
- ));
- }
- }
- }
-
- @Override
- public List getCharacteristics() {
- return Collections.unmodifiableList(characteristics);
- }
-
- @Override
- public String getType() {
- return type;
- }
-
- protected void addCharacteristic(Characteristic characteristic) {
- this.characteristics.add(characteristic);
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/AccessoryInformationService.java b/src/main/java/com/beowulfe/hap/impl/services/AccessoryInformationService.java
deleted file mode 100644
index b821f769d..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/AccessoryInformationService.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.HomekitAccessory;
-import com.beowulfe.hap.impl.characteristics.information.Identify;
-import com.beowulfe.hap.impl.characteristics.information.Manufacturer;
-import com.beowulfe.hap.impl.characteristics.information.Model;
-import com.beowulfe.hap.impl.characteristics.information.SerialNumber;
-
-public class AccessoryInformationService extends AbstractServiceImpl {
-
- public AccessoryInformationService(HomekitAccessory accessory) throws Exception {
- this(accessory, accessory.getLabel());
- }
-
- public AccessoryInformationService(HomekitAccessory accessory, String serviceName) throws Exception {
- super("0000003E-0000-1000-8000-0026BB765291", accessory, serviceName);
- addCharacteristic(new Manufacturer(accessory));
- addCharacteristic(new Model(accessory));
- addCharacteristic(new SerialNumber(accessory));
- addCharacteristic(new Identify(accessory));
- }
-
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/CarbonMonoxideSensorService.java b/src/main/java/com/beowulfe/hap/impl/services/CarbonMonoxideSensorService.java
deleted file mode 100644
index c84633af9..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/CarbonMonoxideSensorService.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.CarbonMonoxideSensor;
-import com.beowulfe.hap.impl.characteristics.carbonmonoxide.CarbonMonoxideDetectedCharacteristic;
-
-public class CarbonMonoxideSensorService extends AbstractServiceImpl {
-
- public CarbonMonoxideSensorService(CarbonMonoxideSensor carbonMonoxideSensor) {
- this(carbonMonoxideSensor, carbonMonoxideSensor.getLabel());
- }
-
- public CarbonMonoxideSensorService(CarbonMonoxideSensor carbonMonoxideSensor, String serviceName) {
- super("0000007F-0000-1000-8000-0026BB765291", carbonMonoxideSensor, serviceName);
- addCharacteristic(new CarbonMonoxideDetectedCharacteristic(carbonMonoxideSensor));
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/ContactSensorService.java b/src/main/java/com/beowulfe/hap/impl/services/ContactSensorService.java
deleted file mode 100644
index 5f7ff17fa..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/ContactSensorService.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.ContactSensor;
-import com.beowulfe.hap.impl.characteristics.contactsensor.ContactSensorStateCharacteristic;
-
-public class ContactSensorService extends AbstractServiceImpl {
-
- public ContactSensorService(ContactSensor contactSensor) {
- this(contactSensor, contactSensor.getLabel());
- }
-
- public ContactSensorService(ContactSensor contactSensor, String serviceName) {
- super("00000080-0000-1000-8000-0026BB765291", contactSensor, serviceName);
- addCharacteristic(new ContactSensorStateCharacteristic(contactSensor));
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/FanService.java b/src/main/java/com/beowulfe/hap/impl/services/FanService.java
deleted file mode 100644
index feb75c1c4..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/FanService.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.Fan;
-import com.beowulfe.hap.impl.characteristics.common.PowerStateCharacteristic;
-import com.beowulfe.hap.impl.characteristics.fan.RotationDirectionCharacteristic;
-import com.beowulfe.hap.impl.characteristics.fan.RotationSpeedCharacteristic;
-
-public class FanService extends AbstractServiceImpl {
-
- public FanService(Fan fan) {
- this(fan, fan.getLabel());
- }
-
- public FanService(Fan fan, String serviceName) {
- super("00000040-0000-1000-8000-0026BB765291", fan, serviceName);
- addCharacteristic(new PowerStateCharacteristic(
- () -> fan.getFanPower(),
- v -> fan.setFanPower(v),
- c -> fan.subscribeFanPower(c),
- () -> fan.unsubscribeFanPower()
- ));
- addCharacteristic(new RotationDirectionCharacteristic(fan));
- addCharacteristic(new RotationSpeedCharacteristic(fan));
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/com/beowulfe/hap/impl/services/GarageDoorService.java b/src/main/java/com/beowulfe/hap/impl/services/GarageDoorService.java
deleted file mode 100644
index 6469a2387..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/GarageDoorService.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.GarageDoor;
-import com.beowulfe.hap.impl.characteristics.common.ObstructionDetectedCharacteristic;
-import com.beowulfe.hap.impl.characteristics.garage.CurrentDoorStateCharacteristic;
-import com.beowulfe.hap.impl.characteristics.garage.TargetDoorStateCharacteristic;
-
-public class GarageDoorService extends AbstractServiceImpl {
-
- public GarageDoorService(GarageDoor door) {
- this(door, door.getLabel());
- }
-
- public GarageDoorService(GarageDoor door, String serviceName) {
- super("00000041-0000-1000-8000-0026BB765291", door, serviceName);
- addCharacteristic(new CurrentDoorStateCharacteristic(door));
- addCharacteristic(new TargetDoorStateCharacteristic(door));
- addCharacteristic(new ObstructionDetectedCharacteristic(() -> door.getObstructionDetected(),
- c -> door.subscribeObstructionDetected(c),
- () -> door.unsubscribeObstructionDetected()));
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/com/beowulfe/hap/impl/services/HumiditySensorService.java b/src/main/java/com/beowulfe/hap/impl/services/HumiditySensorService.java
deleted file mode 100644
index 23b3c354e..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/HumiditySensorService.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.HumiditySensor;
-import com.beowulfe.hap.impl.characteristics.humiditysensor.CurrentRelativeHumidityCharacteristic;
-
-public class HumiditySensorService extends AbstractServiceImpl {
-
- public HumiditySensorService(HumiditySensor sensor) {
- this(sensor, sensor.getLabel());
- }
-
- public HumiditySensorService(HumiditySensor sensor, String serviceName) {
- super("00000082-0000-1000-8000-0026BB765291", sensor, serviceName);
- addCharacteristic(new CurrentRelativeHumidityCharacteristic(sensor));
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/com/beowulfe/hap/impl/services/LightSensorService.java b/src/main/java/com/beowulfe/hap/impl/services/LightSensorService.java
deleted file mode 100644
index b5c1610a3..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/LightSensorService.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.LightSensor;
-import com.beowulfe.hap.impl.characteristics.light.AmbientLightLevelCharacteristic;
-
-public class LightSensorService extends AbstractServiceImpl {
-
- public LightSensorService(LightSensor lightSensor) {
- this(lightSensor, lightSensor.getLabel());
- }
-
- public LightSensorService(LightSensor lightSensor, String serviceName) {
- super("00000084-0000-1000-8000-0026BB765291", lightSensor, serviceName);
- addCharacteristic(new AmbientLightLevelCharacteristic(lightSensor));
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/LightbulbService.java b/src/main/java/com/beowulfe/hap/impl/services/LightbulbService.java
deleted file mode 100644
index 604d7176d..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/LightbulbService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.ColorfulLightbulb;
-import com.beowulfe.hap.accessories.DimmableLightbulb;
-import com.beowulfe.hap.accessories.Lightbulb;
-import com.beowulfe.hap.impl.characteristics.common.PowerStateCharacteristic;
-import com.beowulfe.hap.impl.characteristics.lightbulb.BrightnessCharacteristic;
-import com.beowulfe.hap.impl.characteristics.lightbulb.HueCharacteristic;
-import com.beowulfe.hap.impl.characteristics.lightbulb.SaturationCharacteristic;
-
-public class LightbulbService extends AbstractServiceImpl {
-
- public LightbulbService(Lightbulb lightbulb) {
- this(lightbulb, lightbulb.getLabel());
- }
-
- public LightbulbService(Lightbulb lightbulb, String serviceName) {
- super("00000043-0000-1000-8000-0026BB765291", lightbulb, serviceName);
- addCharacteristic(new PowerStateCharacteristic(
- () -> lightbulb.getLightbulbPowerState(),
- v -> lightbulb.setLightbulbPowerState(v),
- c -> lightbulb.subscribeLightbulbPowerState(c),
- () -> lightbulb.unsubscribeLightbulbPowerState()
- ));
-
- if (lightbulb instanceof DimmableLightbulb) {
- addCharacteristic(new BrightnessCharacteristic((DimmableLightbulb) lightbulb));
- }
-
- if (lightbulb instanceof ColorfulLightbulb) {
- addCharacteristic(new HueCharacteristic((ColorfulLightbulb) lightbulb));
- addCharacteristic(new SaturationCharacteristic((ColorfulLightbulb) lightbulb));
- }
- }
-
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/LockMechanismService.java b/src/main/java/com/beowulfe/hap/impl/services/LockMechanismService.java
deleted file mode 100644
index e2817c1dc..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/LockMechanismService.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.LockMechanism;
-import com.beowulfe.hap.accessories.LockableLockMechanism;
-import com.beowulfe.hap.impl.characteristics.lock.mechanism.CurrentLockMechanismStateCharacteristic;
-import com.beowulfe.hap.impl.characteristics.lock.mechanism.TargetLockMechanismStateCharacteristic;
-
-public class LockMechanismService extends AbstractServiceImpl {
-
- public LockMechanismService(LockMechanism lock) {
- this(lock, lock.getLabel());
- }
-
- public LockMechanismService(LockMechanism lock, String serviceName) {
- super("00000045-0000-1000-8000-0026BB765291", lock, serviceName);
- addCharacteristic(new CurrentLockMechanismStateCharacteristic(lock));
-
- if (lock instanceof LockableLockMechanism) {
- addCharacteristic(new TargetLockMechanismStateCharacteristic((LockableLockMechanism) lock));
- }
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/MotionSensorService.java b/src/main/java/com/beowulfe/hap/impl/services/MotionSensorService.java
deleted file mode 100644
index ed2064f4d..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/MotionSensorService.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.MotionSensor;
-import com.beowulfe.hap.impl.characteristics.motionsensor.MotionDetectedStateCharacteristic;
-
-public class MotionSensorService extends AbstractServiceImpl {
-
- public MotionSensorService(MotionSensor motionSensor) {
- this(motionSensor, motionSensor.getLabel());
- }
-
- public MotionSensorService(MotionSensor motionSensor, String serviceName) {
- super("00000085-0000-1000-8000-0026BB765291", motionSensor, serviceName);
- addCharacteristic(new MotionDetectedStateCharacteristic(motionSensor));
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/OutletService.java b/src/main/java/com/beowulfe/hap/impl/services/OutletService.java
deleted file mode 100644
index d7d5a68de..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/OutletService.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.Outlet;
-import com.beowulfe.hap.impl.characteristics.common.PowerStateCharacteristic;
-import com.beowulfe.hap.impl.characteristics.outlet.OutletInUseCharacteristic;
-
-public class OutletService extends AbstractServiceImpl {
-
- public OutletService(Outlet outlet) {
- this(outlet, outlet.getLabel());
- }
-
- public OutletService(Outlet outlet, String serviceName) {
- super("00000047-0000-1000-8000-0026BB765291", outlet, serviceName);
- addCharacteristic(new PowerStateCharacteristic(
- () -> outlet.getPowerState(),
- v -> outlet.setPowerState(v),
- c -> outlet.subscribePowerState(c),
- () -> outlet.unsubscribePowerState()
- ));
- addCharacteristic(new OutletInUseCharacteristic(outlet));
- }
-
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/SecuritySystemService.java b/src/main/java/com/beowulfe/hap/impl/services/SecuritySystemService.java
deleted file mode 100644
index 6d6f9a6bf..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/SecuritySystemService.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.SecuritySystem;
-import com.beowulfe.hap.impl.characteristics.securitysystem.CurrentSecuritySystemStateCharacteristic;
-import com.beowulfe.hap.impl.characteristics.securitysystem.SecuritySystemAlarmTypeCharacteristic;
-import com.beowulfe.hap.impl.characteristics.securitysystem.TargetSecuritySystemStateCharacteristic;
-
-public class SecuritySystemService extends AbstractServiceImpl {
-
- public SecuritySystemService(SecuritySystem securitySystem) {
- this(securitySystem, securitySystem.getLabel());
- }
-
- public SecuritySystemService(SecuritySystem securitySystem, String serviceName) {
- super("0000007E-0000-1000-8000-0026BB765291", securitySystem, serviceName);
- addCharacteristic(new CurrentSecuritySystemStateCharacteristic(securitySystem));
- addCharacteristic(new TargetSecuritySystemStateCharacteristic(securitySystem));
- addCharacteristic(new SecuritySystemAlarmTypeCharacteristic(securitySystem));
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/SmokeSensorService.java b/src/main/java/com/beowulfe/hap/impl/services/SmokeSensorService.java
deleted file mode 100644
index 2f5c4e993..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/SmokeSensorService.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.SmokeSensor;
-import com.beowulfe.hap.impl.characteristics.smokesensor.SmokeDetectedCharacteristic;
-
-public class SmokeSensorService extends AbstractServiceImpl {
-
- public SmokeSensorService(SmokeSensor smokeSensor) {
- this(smokeSensor, smokeSensor.getLabel());
- }
-
- public SmokeSensorService(SmokeSensor smokeSensor, String serviceName) {
- super("00000087-0000-1000-8000-0026BB765291", smokeSensor, serviceName);
- addCharacteristic(new SmokeDetectedCharacteristic(smokeSensor));
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/SwitchService.java b/src/main/java/com/beowulfe/hap/impl/services/SwitchService.java
deleted file mode 100644
index 8bdda8989..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/SwitchService.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.Switch;
-import com.beowulfe.hap.impl.characteristics.common.PowerStateCharacteristic;
-
-public class SwitchService extends AbstractServiceImpl {
-
- public SwitchService(Switch switchAccessory) {
- this(switchAccessory, switchAccessory.getLabel());
- }
-
- public SwitchService(Switch switchAccessory, String serviceName) {
- super("00000049-0000-1000-8000-0026BB765291", switchAccessory, serviceName);
- addCharacteristic(new PowerStateCharacteristic(
- () -> switchAccessory.getSwitchState(),
- v -> switchAccessory.setSwitchState(v),
- c -> switchAccessory.subscribeSwitchState(c),
- () -> switchAccessory.unsubscribeSwitchState()
- ));
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/com/beowulfe/hap/impl/services/TemperatureSensorService.java b/src/main/java/com/beowulfe/hap/impl/services/TemperatureSensorService.java
deleted file mode 100644
index b29bae501..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/TemperatureSensorService.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.TemperatureSensor;
-import com.beowulfe.hap.impl.characteristics.thermostat.CurrentTemperatureCharacteristic;
-
-public class TemperatureSensorService extends AbstractServiceImpl {
-
- public TemperatureSensorService(TemperatureSensor sensor) {
- this(sensor, sensor.getLabel());
- }
-
- public TemperatureSensorService(TemperatureSensor sensor, String serviceName) {
- super("0000008A-0000-1000-8000-0026BB765291", sensor, serviceName);
- addCharacteristic(new CurrentTemperatureCharacteristic(sensor));
- }
-
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/ThermostatService.java b/src/main/java/com/beowulfe/hap/impl/services/ThermostatService.java
deleted file mode 100644
index 564a28aeb..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/ThermostatService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.thermostat.BasicThermostat;
-import com.beowulfe.hap.accessories.thermostat.CoolingThermostat;
-import com.beowulfe.hap.accessories.thermostat.HeatingThermostat;
-import com.beowulfe.hap.impl.characteristics.thermostat.*;
-
-public class ThermostatService extends AbstractServiceImpl {
-
- public ThermostatService(BasicThermostat thermostat) {
- this(thermostat, thermostat.getLabel());
- }
-
- public ThermostatService(BasicThermostat thermostat, String serviceName) {
- super("0000004A-0000-1000-8000-0026BB765291", thermostat, serviceName);
- addCharacteristic(new CurrentHeatingCoolingModeCharacteristic(thermostat));
- addCharacteristic(new CurrentTemperatureCharacteristic(thermostat));
- addCharacteristic(new TargetHeatingCoolingModeCharacteristic(thermostat));
- addCharacteristic(new TargetTemperatureCharacteristic(thermostat));
- addCharacteristic(new TemperatureUnitsCharacteristic(thermostat));
- if (thermostat instanceof HeatingThermostat) {
- addCharacteristic(new HeatingThresholdTemperatureCharacteristic((HeatingThermostat) thermostat));
- }
- if (thermostat instanceof CoolingThermostat) {
- addCharacteristic(new CoolingThresholdTemperatureCharacteristic((CoolingThermostat) thermostat));
- }
- }
-
-}
diff --git a/src/main/java/com/beowulfe/hap/impl/services/WindowCoveringService.java b/src/main/java/com/beowulfe/hap/impl/services/WindowCoveringService.java
deleted file mode 100644
index 18d6499ba..000000000
--- a/src/main/java/com/beowulfe/hap/impl/services/WindowCoveringService.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.beowulfe.hap.impl.services;
-
-import com.beowulfe.hap.accessories.HorizontalTiltingWindowCovering;
-import com.beowulfe.hap.accessories.VerticalTiltingWindowCovering;
-import com.beowulfe.hap.accessories.WindowCovering;
-import com.beowulfe.hap.impl.characteristics.common.ObstructionDetectedCharacteristic;
-import com.beowulfe.hap.impl.characteristics.windowcovering.*;
-
-public class WindowCoveringService extends AbstractServiceImpl {
-
- public WindowCoveringService(WindowCovering windowCovering) {
- this(windowCovering, windowCovering.getLabel());
- }
-
- public WindowCoveringService(WindowCovering windowCovering, String serviceName) {
- super("0000008C-0000-1000-8000-0026BB765291", windowCovering, serviceName);
- addCharacteristic(new CurrentPositionCharacteristic(windowCovering));
- addCharacteristic(new HoldPositionCharacteristic(windowCovering));
- addCharacteristic(new PositionStateCharacteristic(windowCovering));
- addCharacteristic(new TargetPositionCharacteristic(windowCovering));
- addCharacteristic(new ObstructionDetectedCharacteristic(() -> windowCovering.getObstructionDetected(),
- c -> windowCovering.subscribeObstructionDetected(c),
- () -> windowCovering.unsubscribeObstructionDetected()));
-
- if (windowCovering instanceof HorizontalTiltingWindowCovering) {
- addCharacteristic(new CurrentHorizontalTiltAngleCharacteristic(
- (HorizontalTiltingWindowCovering) windowCovering));
- addCharacteristic(new TargetHorizontalTiltAngleCharacteristic(
- (HorizontalTiltingWindowCovering) windowCovering));
- }
- if (windowCovering instanceof VerticalTiltingWindowCovering) {
- addCharacteristic(new CurrentVerticalTiltAngleCharacteristic(
- (VerticalTiltingWindowCovering) windowCovering));
- addCharacteristic(new TargetVerticalTiltAngleCharacteristic(
- (VerticalTiltingWindowCovering) windowCovering));
- }
- }
-}
diff --git a/src/main/java/com/beowulfe/hap/package-info.java b/src/main/java/com/beowulfe/hap/package-info.java
deleted file mode 100644
index 2a3f7b220..000000000
--- a/src/main/java/com/beowulfe/hap/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * Base package for implementing the Homekit Accessory Protocol. Start with {@link com.beowulfe.hap.HomekitServer}.
- */
-package com.beowulfe.hap;
\ No newline at end of file
diff --git a/src/main/java/io/github/hapjava/accessories/AirPurifierAccessory.java b/src/main/java/io/github/hapjava/accessories/AirPurifierAccessory.java
new file mode 100644
index 000000000..3766f75a1
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/AirPurifierAccessory.java
@@ -0,0 +1,86 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.airpurifier.CurrentAirPurifierStateEnum;
+import io.github.hapjava.characteristics.impl.airpurifier.TargetAirPurifierStateEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.AirPurifierService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/** An air purifier. */
+public interface AirPurifierAccessory extends HomekitAccessory {
+ /**
+ * Mandatory: Retrieves the current active state of the fan'.
+ *
+ * @return a future that will contain the binary state
+ */
+ CompletableFuture isActive();
+
+ /**
+ * Sets the active state of the fan
+ *
+ * @param state the binary state to set
+ * @return a future that completes when the change is made
+ * @throws Exception when the change cannot be made
+ */
+ CompletableFuture setActive(boolean state) throws Exception;
+
+ /**
+ * Subscribes to changes in the active state of the fan.
+ *
+ * @param callback the function to call when the direction changes.
+ */
+ void subscribeActive(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the active state of the fan. */
+ void unsubscribeActive();
+
+ /**
+ * Retrieves the current state of the air purifier
+ *
+ * @return a future that will contain the state
+ */
+ CompletableFuture getCurrentState();
+
+ /**
+ * Subscribes to changes in the state of the air purifier.
+ *
+ * @param callback the function to call when the state changes.
+ */
+ void subscribeCurrentState(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the state of the air purifier. */
+ void unsubscribeCurrentState();
+
+ /**
+ * Retrieves the air purifier target state.
+ *
+ * @return a future that will contain the air purifier target state .
+ */
+ CompletableFuture getTargetState();
+
+ /**
+ * set target state the air purifier target state.
+ *
+ * @param state air purifier target state
+ * @return a future that completes when the change is made
+ */
+ CompletableFuture setTargetState(TargetAirPurifierStateEnum state);
+
+ /**
+ * Subscribes to changes in the target state of the air purifier.
+ *
+ * @param callback the function to call when the target state changes.
+ */
+ void subscribeTargetState(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the target state of the air purifier. */
+ void unsubscribeTargetState();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new AirPurifierService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/AirQualityAccessory.java b/src/main/java/io/github/hapjava/accessories/AirQualityAccessory.java
new file mode 100644
index 000000000..309fb486e
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/AirQualityAccessory.java
@@ -0,0 +1,35 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.airquality.AirQualityEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.AirQualityService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/** An air quality accessory which can include several sensors. */
+public interface AirQualityAccessory extends HomekitAccessory {
+
+ /**
+ * Retrieves the state of the air quality
+ *
+ * @return a future that will contain the state
+ */
+ CompletableFuture getAirQuality();
+
+ /**
+ * Subscribes to changes in the air quality
+ *
+ * @param callback the function to call when the air quality changes.
+ */
+ void subscribeAirQuality(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the air quality. */
+ void unsubscribeAirQuality();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new AirQualityService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/BasicFanAccessory.java b/src/main/java/io/github/hapjava/accessories/BasicFanAccessory.java
new file mode 100644
index 000000000..98c4bf497
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/BasicFanAccessory.java
@@ -0,0 +1,46 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.BasicFanService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * A fan with mandatory characteristics.
+ *
+ * @author Andy Lintner
+ */
+public interface BasicFanAccessory extends HomekitAccessory {
+ /**
+ * Mandatory: Retrieves the current power state of the fan.
+ *
+ * @return a future that will contain the binary state
+ */
+ CompletableFuture isOn();
+
+ /**
+ * Sets the active state of the fan
+ *
+ * @param state the binary state to set
+ * @return a future that completes when the change is made
+ * @throws Exception when the change cannot be made
+ */
+ CompletableFuture setOn(boolean state) throws Exception;
+
+ /**
+ * Subscribes to changes in the active state of the fan.
+ *
+ * @param callback the function to call when the active state changes.
+ */
+ void subscribeOn(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the active state of the fan. */
+ void unsubscribeOn();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new BasicFanService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/BatteryAccessory.java b/src/main/java/io/github/hapjava/accessories/BatteryAccessory.java
new file mode 100644
index 000000000..d3724bc50
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/BatteryAccessory.java
@@ -0,0 +1,74 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.battery.ChargingStateEnum;
+import io.github.hapjava.characteristics.impl.battery.StatusLowBatteryEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.BatteryService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * Devices with battery .
+ *
+ * @author Gaston Dombiak
+ */
+public interface BatteryAccessory extends HomekitAccessory {
+
+ /**
+ * Retrieves the battery level of the accessory.
+ *
+ * @return a future that will contain the accessory's battery state
+ */
+ CompletableFuture getBatteryLevel();
+
+ /**
+ * Queries if the device battery level is low; returning a value of true will cause a low-battery
+ * status to appear in Home for the device.
+ *
+ * @return a future that will contain the accessory's low battery state
+ */
+ CompletableFuture getLowBatteryState();
+
+ /**
+ * Retriece the battery charging state.
+ *
+ * @return a future that will contain the battery charging state
+ */
+ CompletableFuture getChargingState();
+
+ /**
+ * Subscribes to changes in the battery level.
+ *
+ * @param callback the function to call when battery level changes.
+ */
+ void subscribeBatteryLevel(HomekitCharacteristicChangeCallback callback);
+ /**
+ * Subscribes to changes in the battery level.
+ *
+ * @param callback the function to call when low battery state changes.
+ */
+ void subscribeLowBatteryState(HomekitCharacteristicChangeCallback callback);
+
+ /**
+ * Subscribes to changes in the battery level.
+ *
+ * @param callback the function to call when low battery state changes.
+ */
+ void subscribeBatteryChargingState(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the battery level. */
+ void unsubscribeBatteryLevel();
+
+ /** Unsubscribes from changes in the low battery state. */
+ void unsubscribeLowBatteryState();
+
+ /** Unsubscribes from changes in the low battery state. */
+ void unsubscribeBatteryChargingState();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new BatteryService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/Bridge.java b/src/main/java/io/github/hapjava/accessories/Bridge.java
new file mode 100644
index 000000000..e53c427f2
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/Bridge.java
@@ -0,0 +1,8 @@
+package io.github.hapjava.accessories;
+
+/** HomeKit bridge service. */
+public interface Bridge extends HomekitAccessory {
+
+ @Override
+ default void identify() {}
+}
diff --git a/src/main/java/io/github/hapjava/accessories/CarbonDioxideSensorAccessory.java b/src/main/java/io/github/hapjava/accessories/CarbonDioxideSensorAccessory.java
new file mode 100644
index 000000000..185aedd13
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/CarbonDioxideSensorAccessory.java
@@ -0,0 +1,35 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.carbondioxidesensor.CarbonDioxideDetectedEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.CarbonDioxideSensorService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/** A carbon dioxide sensor reports carbon dioxide level. */
+public interface CarbonDioxideSensorAccessory extends HomekitAccessory {
+
+ /**
+ * Retrieves the state of the sensor that indicates if carbon dioxide has been detected.
+ *
+ * @return a future that will contain the carbon dioxide sensor's state
+ */
+ CompletableFuture getCarbonDioxideDetectedState();
+
+ /**
+ * Subscribes to changes in the carbon dioxide's state.
+ *
+ * @param callback the function to call when the state changes.
+ */
+ void subscribeCarbonDioxideDetectedState(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the carbon dioxide's state. */
+ void unsubscribeCarbonDioxideDetectedState();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new CarbonDioxideSensorService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/CarbonMonoxideSensorAccessory.java b/src/main/java/io/github/hapjava/accessories/CarbonMonoxideSensorAccessory.java
new file mode 100644
index 000000000..93cfebbd6
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/CarbonMonoxideSensorAccessory.java
@@ -0,0 +1,39 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.carbonmonoxidesensor.CarbonMonoxideDetectedEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.CarbonMonoxideSensorService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * A carbon monoxide sensor reports whether carbon monoxide has been detected or not.
+ *
+ * @author Gaston Dombiak
+ */
+public interface CarbonMonoxideSensorAccessory extends HomekitAccessory {
+
+ /**
+ * Retrieves the state of the sensor that indicates if carbon monoxide has been detected.
+ *
+ * @return a future that will contain the carbon monoxide sensor's state
+ */
+ CompletableFuture getCarbonMonoxideDetectedState();
+
+ /**
+ * Subscribes to changes in the carbon monoxide's state.
+ *
+ * @param callback the function to call when the state changes.
+ */
+ void subscribeCarbonMonoxideDetectedState(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the carbon monoxide's state. */
+ void unsubscribeCarbonMonoxideDetectedState();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new CarbonMonoxideSensorService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/ContactSensorAccessory.java b/src/main/java/io/github/hapjava/accessories/ContactSensorAccessory.java
new file mode 100644
index 000000000..754f6981b
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/ContactSensorAccessory.java
@@ -0,0 +1,41 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.contactsensor.ContactStateEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.ContactSensorService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * A contact sensor that reports whether contact is detected or not. Typical contact sensors are
+ * window/door sensors. When contact is detected it means that the door/window is closed.
+ *
+ * @author Gaston Dombiak
+ */
+public interface ContactSensorAccessory extends HomekitAccessory {
+
+ /**
+ * Retrieves the state of the contact. This is whether the contact is detected or not. Detected
+ * contact means door/window is closed.
+ *
+ * @return a future that will contain the contact's state
+ */
+ CompletableFuture getCurrentState();
+
+ /**
+ * Subscribes to changes in the contact state.
+ *
+ * @param callback the function to call when the state changes.
+ */
+ void subscribeContactState(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the contact state. */
+ void unsubscribeContactState();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new ContactSensorService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/DoorAccessory.java b/src/main/java/io/github/hapjava/accessories/DoorAccessory.java
new file mode 100644
index 000000000..1049c7686
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/DoorAccessory.java
@@ -0,0 +1,78 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.windowcovering.PositionStateEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.DoorService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/** A motorized door with current and target position. */
+public interface DoorAccessory extends HomekitAccessory {
+
+ /**
+ * Retrieves the position state of the door
+ *
+ * @return a future which will contain the door's position state
+ */
+ CompletableFuture getPositionState();
+
+ /**
+ * Retrieves the current position of the door
+ *
+ * @return a future which will contain the door's current position
+ */
+ CompletableFuture getCurrentPosition();
+
+ /**
+ * Retrieves the target position of the door
+ *
+ * @return a future which will contain the door's target position
+ */
+ CompletableFuture getTargetPosition();
+
+ /**
+ * Sets the targeted state of the door.
+ *
+ * @param position the targeted position
+ * @return a future that completes when the change is made
+ * @throws Exception when the change cannot be made
+ */
+ CompletableFuture setTargetPosition(Integer position) throws Exception;
+
+ /**
+ * Subscribes to changes in the door's position state
+ *
+ * @param callback the function to call when the state changes
+ */
+ void subscribePositionState(HomekitCharacteristicChangeCallback callback);
+
+ /**
+ * Subscribes to changes in the door's current position
+ *
+ * @param callback the function to call when the current position changes
+ */
+ void subscribeCurrentPosition(HomekitCharacteristicChangeCallback callback);
+
+ /**
+ * Subscribes to changes in the door's target position
+ *
+ * @param callback the function to call when the target position changes
+ */
+ void subscribeTargetPosition(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the door's state */
+ void unsubscribePositionState();
+
+ /** Unsubscribes from changes in the door's current position */
+ void unsubscribeCurrentPosition();
+
+ /** Unsubscribes from changes in the door's target position */
+ void unsubscribeTargetPosition();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new DoorService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/DoorbellAccessory.java b/src/main/java/io/github/hapjava/accessories/DoorbellAccessory.java
new file mode 100644
index 000000000..d46d4a00e
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/DoorbellAccessory.java
@@ -0,0 +1,36 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.common.ProgrammableSwitchEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.DoorbellService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/** doorbell accessory with a switch (button push) event. */
+public interface DoorbellAccessory extends HomekitAccessory {
+
+ /**
+ * Retrieves the last states of the doorbell. Bluetooth device should return the last event, the
+ * IP device should always return null
+ *
+ * @return state of the door bell event
+ */
+ CompletableFuture getSwitchEvent();
+
+ /**
+ * Subscribes to changes in doorbell switch event, i.e. pressing on the door bell button.
+ *
+ * @param callback the function to call when the state changes.
+ */
+ void subscribeSwitchEvent(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in doorbell switch event. */
+ void unsubscribeSwitchEvent();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new DoorbellService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/FanAccessory.java b/src/main/java/io/github/hapjava/accessories/FanAccessory.java
new file mode 100644
index 000000000..641214e76
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/FanAccessory.java
@@ -0,0 +1,46 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.FanService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * A fan with mandatory characteristics.
+ *
+ * @author Andy Lintner
+ */
+public interface FanAccessory extends HomekitAccessory {
+ /**
+ * Mandatory: Retrieves the current active state of the fan'.
+ *
+ * @return a future that will contain the binary state
+ */
+ CompletableFuture isActive();
+
+ /**
+ * Sets the active state of the fan
+ *
+ * @param state the binary state to set
+ * @return a future that completes when the change is made
+ * @throws Exception when the change cannot be made
+ */
+ CompletableFuture setActive(boolean state) throws Exception;
+
+ /**
+ * Subscribes to changes in the active state of the fan.
+ *
+ * @param callback the function to call when the active state changes.
+ */
+ void subscribeActive(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the active state of the fan. */
+ void unsubscribeActive();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new FanService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/FaucetAccessory.java b/src/main/java/io/github/hapjava/accessories/FaucetAccessory.java
new file mode 100644
index 000000000..7a000fcec
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/FaucetAccessory.java
@@ -0,0 +1,42 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.FaucetService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/** Faucets or shower heads accessory. */
+public interface FaucetAccessory extends HomekitAccessory {
+ /**
+ * Mandatory: Retrieves the current active state of the faucet.
+ *
+ * @return a future that will contain the binary state
+ */
+ CompletableFuture isActive();
+
+ /**
+ * Sets the active state of the faucet
+ *
+ * @param state the binary state to set
+ * @return a future that completes when the change is made
+ * @throws Exception when the change cannot be made
+ */
+ CompletableFuture setActive(boolean state) throws Exception;
+
+ /**
+ * Subscribes to changes in the active state of the faucet.
+ *
+ * @param callback the function to call when the active state changes.
+ */
+ void subscribeActive(HomekitCharacteristicChangeCallback callback);
+
+ /** Unsubscribes from changes in the active state of the faucet. */
+ void unsubscribeActive();
+
+ @Override
+ default Collection getServices() {
+ return Collections.singleton(new FaucetService(this));
+ }
+}
diff --git a/src/main/java/io/github/hapjava/accessories/FilterMaintenanceAccessory.java b/src/main/java/io/github/hapjava/accessories/FilterMaintenanceAccessory.java
new file mode 100644
index 000000000..2ebee5495
--- /dev/null
+++ b/src/main/java/io/github/hapjava/accessories/FilterMaintenanceAccessory.java
@@ -0,0 +1,40 @@
+package io.github.hapjava.accessories;
+
+import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
+import io.github.hapjava.characteristics.impl.filtermaintenance.FilterChangeIndicationEnum;
+import io.github.hapjava.services.Service;
+import io.github.hapjava.services.impl.FilterMaintenanceService;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * A Filter maintenance with mandatory characteristics.
+ *
+ *