Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hap-java/HAP-Java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: hap-1.1.5
Choose a base ref
...
head repository: hap-java/HAP-Java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 535 changed files with 16,113 additions and 5,192 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven and Deploy

on:
push:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11 for Maven Central
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
architecture: x64
server-id: ossrh
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- name: Setup git profile
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Publish Snapshot to Maven Central
run: mvn deploy -B -Possrh
env:
MAVEN_USERNAME: hap-java-dev
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Publish site
run: mvn -B site-deploy -Dusername=github-actions -Dpassword=${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
architecture: x64
- name: Build with Maven
run: mvn -B package --file pom.xml
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Stage Release on Master Branch

on:
workflow_dispatch:
inputs:
releaseVersion:
description: Version to release
required: true

permissions:
contents: write

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: git-actions/set-user@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
architecture: x64
server-id: ossrh
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- name: Maven release
run: mvn release:prepare release:perform -B -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -Possrh
env:
MAVEN_USERNAME: hap-java-dev
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: java
jdk: oraclejdk8
jdk: openjdk8
after_success:
- openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in deploy/pubring.gpg.enc -out
deploy/pubring.gpg -d
70 changes: 70 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
# HAP-Java 2.0.6
* Several methods allowing library users to manipulate characteristics themselves
* Allow library users to provider their own implementation of AccessoryInformationService
* Fix ProgrammableSwitchEventEnum that has an incorrect value

# HAP-Java 2.0.5
* Implement List-Pairings method. Compatibility with new Home infrastructure from iOS 16.2?

# HAP-Java 2.0.3
* Avoid unnecessary forced disconnects. Library users should be updating the configuration index anyway.

# HAP-Java 2.0.2
* Various minor stability issues for after an accessory has been removed.

# HAP-Java 2.0.1
## Fixes
* Log accessory names instead of futures. [#150](https://github.com/hap-java/HAP-Java/issues/150)
* Fix rotation speed data type (BREAKING API CHANGE). According to HAP specification it must be float
* Close JsonWriters [#149](https://github.com/hap-java/HAP-Java/issues/149)
* Fix UUID of HAP Version characteristic
* Add Mute characteristic to Doorbell service

## New
* New characteristics:
* Identifier
* Input Device Type
* Input Source Type
* Configured Name
* Current Visibility State
* Target Visibility State
* Sleep Discovery Mode
* Active Identifier
* Closed Captions
* Current Media State
* Target Media State
* Picture Mode
* Power Mode
* Remote Key
* Volume Control Type
* Volume Selector
* AirPlay Enable

* New services
* Input Source
* Television
* Television Speaker
* Smart Speaker

# HAP-Java 2.0.0
* major refactoring to support optional characteristics
* structure and names adapted to HAP spec structure and naming.
* structure is following
* `accessory` package include basis accessory as the listed in HAP spec, plus interfaces for optional characteristics. clients should extend the accessory classes. e.g. `WindowCoveringAccessory` or `AccessoryWithBrightness`
* `characteristics` package consists of all characteristics, optional and mandatory. e.g. `TargetHorizontalTiltAngleCharacteristic`. The naming is done in accordance to HAP spec.
* `services` package consists of services, which grouping characteristics. e.g. `WindowCoveringService` defines mandatory and optional characteristics for a window covering service as it is defined in HAP spec.
* `server` package consists classes to run HomeKit server and handle communication
* the process is following: client, e.g. openHAB bindings, extends accessory classes, e.g. `WindowCoveringAccessory` and implements all required methods. WindowCoveringAccessory is linked already to WindowCoveringService, that in turn is link to single characteristics.
* linked service support

## New and improved

* Valid values are supported for enum characteristics instead of min and max values
* Supported valid states for Thermostat, SecuritySystem, HeaterCooler and HumidifierDehumidifier [#108] [#120](https://github.com/hap-java/HAP-Java/pull/120)
* Support for FilterMaintenance. Can be used as a linked service for an Air Purifier [#124](https://github.com/hap-java/HAP-Java/pull/124)

## Fixes

* Fix for re-advertising service when using alternative jMDNS implementations.

# HAP-Java 1.1.5

## Fixes
@@ -11,6 +80,7 @@
* Fix various spec violations and optimize communications to improve performance [#65](https://github.com/hap-java/HAP-Java/pull/65)
* Fix a pairing issue in which HAP-Java could listen on a different interface than that which it advertises [#67](https://github.com/hap-java/HAP-Java/pull/67)
* Allow window covering to be used without optional characteristics. The inclusion of `HoldPositionCharacteristic` did terrible things, and we're still not sure why. Addressed [#56](https://github.com/hap-java/HAP-Java/pull/56)
* Air Purifier didn't support rotation speed characteristics. [#124](https://github.com/hap-java/HAP-Java/pull/124)

## New and improved

73 changes: 67 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,83 @@
HAP-Java
=========
HAP-Java is a Java implementation of the Homekit Accessory Protocol.
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.hap-java/hap/badge.svg)](https://search.maven.org/search?q=g:io.github.hap-java%20a:hap)
[![MIT License](https://img.shields.io/github/license/hap-java/HAP-Java)](https://github.com/hap-java/HAP-Java/blob/master/LICENSE)
![Maven Build Status](https://github.com/andylintner/HAP-Java/actions/workflows/maven.yml/badge.svg)

Using this library, you can create your own Homekit Accessory or Homekit Accessory Bridge.
HAP-Java is a Java implementation of the HomeKit Accessory Protocol.

Because the MFi Specification is closed to individual developers, and this implementation was made without access to that specification, it may not be complete. iOS devices do recognize and are able to interact with accessories exposed via this library however.
Using this library, you can create your own HomeKit Accessory or HomeKit Accessory Bridge.

This library would not have been possible without [Tian Zhang](https://github.com/KhaosT) who did a lot of the hard work of figuring out how the protocol works in his NodeJS implementation.

Usage
=========
Include HAP-Java in your project using maven:

```
<dependency>
<groupId>com.beowulfe.hap</groupId>
<groupId>io.github.hap-java</groupId>
<artifactId>hap</artifactId>
<version>1.1.3</version>
<version>2.0.1-SNAPSHOT</version>
</dependency>
```

After that, read the [Javadoc](http://beowulfe.github.io/HAP-Java/apidocs/) and check out the [Sample](https://github.com/beowulfe/HAP-Java/tree/sample).
After that, check out the [Sample](https://github.com/hap-java/HAP-Java/tree/sample) and
read the [Javadoc](https://hap-java.github.io/HAP-Java/apidocs/index.html)

Supported HomeKit Accessories
=========

Current implementation fully supports 42 HomeKit accessory/services.

| HomeKit Accessory & Service type | Supported by Java-HAP |
|--------------------|--------------------|
| Accessory Information | :white_check_mark: |
| Air Purifier | :white_check_mark: |
| Air Quality Sensor | :white_check_mark: |
| Audio Stream Management | :x: |
| Battery Service | :white_check_mark: |
| Camera RTP Stream Management | :x: |
| Carbon Dioxide Sensor | :white_check_mark: |
| Carbon Monoxide Sensor | :white_check_mark: |
| Contact Sensor | :white_check_mark: |
| Data Stream Transport Management | :x: |
| Door | :white_check_mark: |
| Doorbell | :white_check_mark: |
| Fan | :white_check_mark: |
| Faucet | :white_check_mark: |
| Filter Maintenance | :white_check_mark: |
| Garage Door Opener | :white_check_mark: |
| HAP Protocol Information | :white_check_mark: |
| Heater Cooler | :white_check_mark: |
| Humidifier Dehumidifier | :white_check_mark: |
| Humidity Sensor | :white_check_mark: |
| Input Source | :white_check_mark: |
| Irrigation System | :white_check_mark: |
| Leak Sensor | :white_check_mark: |
| Light Bulb | :white_check_mark: |
| Light Sensor | :white_check_mark: |
| Lock Management | :x: |
| Lock Mechanism | :white_check_mark: |
| Microphone | :white_check_mark: |
| Motion Sensor | :white_check_mark: |
| Occupancy Sensor | :white_check_mark: |
| Outlet | :white_check_mark: |
| Security System | :white_check_mark: |
| Service Label | :white_check_mark: |
| Siri | :x: |
| Slat | :white_check_mark: |
| Smart Speaker | :white_check_mark: |
| Smoke Sensor | :white_check_mark: |
| Speaker | :white_check_mark: |
| Stateless Programmable Switch | :white_check_mark: |
| Switch | :white_check_mark: |
| Target Control | :x: |
| Target Control Management | :x: |
| Television | :white_check_mark: |
| Television Speaker | :white_check_mark: |
| Temperature Sensor | :white_check_mark: |
| Thermostat | :white_check_mark: |
| Valve | :white_check_mark: |
| Window | :white_check_mark: |
| Window Covering | :white_check_mark: |
7 changes: 7 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# How to release HAP-Java

These actions can only be performed by someone with maintainer level access to the repository.

1. Run the [Stage Release on Master Branch](https://github.com/hap-java/HAP-Java/actions/workflows/release.yml) Action with a version such as `2.0.2`
2. After this completes, find the release on the [Releases page](https://github.com/hap-java/HAP-Java/releases)
3. Edit the release to include the changelog details
18 changes: 0 additions & 18 deletions deploy/distribution.xml

This file was deleted.

5 changes: 0 additions & 5 deletions deploy/publish.sh

This file was deleted.

Binary file removed deploy/pubring.gpg.enc
Binary file not shown.
Binary file removed deploy/secring.gpg.enc
Binary file not shown.
9 changes: 0 additions & 9 deletions deploy/settings.xml

This file was deleted.

Loading