-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[homekit] Add (partial) Doorbell Service (#17130)
* [homekit] add Doorbell Service this is _not_ sufficient for HomeKit to present a doorbell. it just shows as an unsupported accessory with the house icon, Signed-off-by: Cody Cutrer <cody@cutrer.us>
- Loading branch information
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...omekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitDoorbellImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.io.homekit.internal.accessories; | ||
|
||
import java.util.List; | ||
|
||
import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; | ||
import org.openhab.io.homekit.internal.HomekitException; | ||
import org.openhab.io.homekit.internal.HomekitSettings; | ||
import org.openhab.io.homekit.internal.HomekitTaggedItem; | ||
|
||
import io.github.hapjava.characteristics.Characteristic; | ||
import io.github.hapjava.characteristics.impl.common.ProgrammableSwitchEventCharacteristic; | ||
import io.github.hapjava.services.impl.DoorbellService; | ||
|
||
/** | ||
* Implements a HomeKit Doorbell | ||
* | ||
* This is only the primary service. To implement the entire video doorbell | ||
* profile, you also need to add a Camera RTP Stream Management service, | ||
* a Speaker service, and Microphone service. | ||
* | ||
* @author Cody Cutrer - Initial contribution | ||
*/ | ||
class HomekitDoorbellImpl extends AbstractHomekitAccessoryImpl { | ||
|
||
public HomekitDoorbellImpl(HomekitTaggedItem taggedItem, List<HomekitTaggedItem> mandatoryCharacteristics, | ||
List<Characteristic> mandatoryRawCharacteristics, HomekitAccessoryUpdater updater, | ||
HomekitSettings settings) { | ||
super(taggedItem, mandatoryCharacteristics, mandatoryRawCharacteristics, updater, settings); | ||
} | ||
|
||
@Override | ||
public void init() throws HomekitException { | ||
super.init(); | ||
addService(new DoorbellService(getCharacteristic(ProgrammableSwitchEventCharacteristic.class).get())); | ||
} | ||
} |