forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[somfytahoma] Add support for noise and CO2 sensor (openhab#15671)
Signed-off-by: Ondrej Pecta <opecta@gmail.com> Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
- Loading branch information
Showing
10 changed files
with
164 additions
and
1 deletion.
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
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
33 changes: 33 additions & 0 deletions
33
...g/openhab/binding/somfytahoma/internal/handler/SomfyTahomaCarbonDioxideSensorHandler.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,33 @@ | ||
/** | ||
* 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.somfytahoma.internal.handler; | ||
|
||
import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.CO2_CONCENTRATION; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.core.thing.Thing; | ||
|
||
/** | ||
* The {@link SomfyTahomaCarbonDioxideSensorHandler} is responsible for handling commands, | ||
* which are sent to one of the channels of the carbon dioxide sensor thing. | ||
* | ||
* @author Ondrej Pecta - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class SomfyTahomaCarbonDioxideSensorHandler extends SomfyTahomaBaseThingHandler { | ||
|
||
public SomfyTahomaCarbonDioxideSensorHandler(Thing thing) { | ||
super(thing); | ||
stateNames.put(CO2_CONCENTRATION, "core:CO2ConcentrationState"); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
.../java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaNoiseSensorHandler.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,33 @@ | ||
/** | ||
* 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.somfytahoma.internal.handler; | ||
|
||
import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.NOISE; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.core.thing.Thing; | ||
|
||
/** | ||
* The {@link SomfyTahomaNoiseSensorHandler} is responsible for handling commands, | ||
* which are sent to one of the channels of the noise sensor thing. | ||
* | ||
* @author Ondrej Pecta - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class SomfyTahomaNoiseSensorHandler extends SomfyTahomaBaseThingHandler { | ||
|
||
public SomfyTahomaNoiseSensorHandler(Thing thing) { | ||
super(thing); | ||
stateNames.put(NOISE, "core:NoiseState"); | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/co2sensor.xml
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,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<thing:thing-descriptions bindingId="somfytahoma" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> | ||
|
||
<thing-type id="co2sensor"> | ||
<supported-bridge-type-refs> | ||
<bridge-type-ref id="bridge"/> | ||
</supported-bridge-type-refs> | ||
<label>Somfy CO2 Sensor</label> | ||
<channels> | ||
<channel id="co2_concentration" typeId="co2_concentration"></channel> | ||
</channels> | ||
<representation-property>url</representation-property> | ||
<config-description-ref uri="thing-type:somfytahoma:device"/> | ||
</thing-type> | ||
|
||
</thing:thing-descriptions> |
19 changes: 19 additions & 0 deletions
19
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/noisesensor.xml
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,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<thing:thing-descriptions bindingId="somfytahoma" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" | ||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> | ||
|
||
<thing-type id="noisesensor"> | ||
<supported-bridge-type-refs> | ||
<bridge-type-ref id="bridge"/> | ||
</supported-bridge-type-refs> | ||
<label>Somfy Noise Sensor</label> | ||
<channels> | ||
<channel id="noise" typeId="noise"></channel> | ||
</channels> | ||
<representation-property>url</representation-property> | ||
<config-description-ref uri="thing-type:somfytahoma:device"/> | ||
</thing-type> | ||
|
||
</thing:thing-descriptions> |