forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hue] Support new home security products (openhab#15601)
Signed-off-by: Andrew Fiddian-Green <[email protected]>
- Loading branch information
Showing
16 changed files
with
473 additions
and
29 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
48 changes: 48 additions & 0 deletions
48
...b.binding.hue/src/main/java/org/openhab/binding/hue/internal/dto/clip2/ContactReport.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-2023 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.binding.hue.internal.dto.clip2; | ||
|
||
import java.time.Instant; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.binding.hue.internal.dto.clip2.enums.ContactStateType; | ||
|
||
/** | ||
* DTO for CLIP 2 home security alarm contact. | ||
* | ||
* @author Andrew Fiddian-Green - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class ContactReport { | ||
|
||
private @NonNullByDefault({}) Instant changed; | ||
private @NonNullByDefault({}) String state; | ||
|
||
public ContactStateType getContactState() throws IllegalArgumentException { | ||
return ContactStateType.valueOf(state.toUpperCase()); | ||
} | ||
|
||
public Instant getLastChanged() { | ||
return changed; | ||
} | ||
|
||
public ContactReport setLastChanged(Instant changed) { | ||
this.changed = changed; | ||
return this; | ||
} | ||
|
||
public ContactReport setContactState(String state) { | ||
this.state = state; | ||
return this; | ||
} | ||
} |
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
...ab.binding.hue/src/main/java/org/openhab/binding/hue/internal/dto/clip2/TamperReport.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-2023 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.binding.hue.internal.dto.clip2; | ||
|
||
import java.time.Instant; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.binding.hue.internal.dto.clip2.enums.TamperStateType; | ||
|
||
/** | ||
* DTO for CLIP 2 home security tamper switch. | ||
* | ||
* @author Andrew Fiddian-Green - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class TamperReport { | ||
|
||
private @NonNullByDefault({}) Instant changed; | ||
private @NonNullByDefault({}) String state; | ||
|
||
public Instant getLastChanged() { | ||
return changed; | ||
} | ||
|
||
public TamperStateType getTamperState() throws IllegalArgumentException { | ||
return TamperStateType.valueOf(state.toUpperCase()); | ||
} | ||
|
||
public TamperReport setLastChanged(Instant changed) { | ||
this.changed = changed; | ||
return this; | ||
} | ||
|
||
public TamperReport setTamperState(String state) { | ||
this.state = state; | ||
return this; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
....hue/src/main/java/org/openhab/binding/hue/internal/dto/clip2/enums/ContactStateType.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,26 @@ | ||
/** | ||
* Copyright (c) 2010-2023 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.binding.hue.internal.dto.clip2.enums; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* Enum for security contact states. | ||
* | ||
* @author Andrew Fiddian-Green - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public enum ContactStateType { | ||
NO_CONTACT, | ||
CONTACT | ||
} |
Oops, something went wrong.