-
-
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.
[guntamatic] Add channel groups (#17901)
* guntamatic indexed channels Signed-off-by: Michael Weger <[email protected]>
- Loading branch information
1 parent
fc9e564
commit 84021f0
Showing
9 changed files
with
1,296 additions
and
936 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
62 changes: 0 additions & 62 deletions
62
.../src/main/java/org/openhab/binding/guntamatic/internal/GuntamaticChannelTypeProvider.java
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
.../src/main/java/org/openhab/binding/guntamatic/internal/GuntamaticDynamicTypeProvider.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,45 @@ | ||
/** | ||
* 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.binding.guntamatic.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.core.storage.StorageService; | ||
import org.openhab.core.thing.ThingUID; | ||
import org.openhab.core.thing.binding.AbstractStorageBasedTypeProvider; | ||
import org.openhab.core.thing.type.ChannelType; | ||
import org.openhab.core.thing.type.ChannelTypeProvider; | ||
import org.osgi.service.component.annotations.Activate; | ||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Reference; | ||
|
||
/** | ||
* The {@link GuntamaticDynamicTypeProvider} is an instance of a {@link AbstractStorageBasedTypeProvider} for the | ||
* Guntamatic Binding | ||
* | ||
* @author Weger Michael - Initial contribution | ||
*/ | ||
@Component(service = { GuntamaticDynamicTypeProvider.class, ChannelTypeProvider.class }) | ||
@NonNullByDefault | ||
public class GuntamaticDynamicTypeProvider extends AbstractStorageBasedTypeProvider { | ||
|
||
@Activate | ||
public GuntamaticDynamicTypeProvider(@Reference StorageService storageService) { | ||
super(storageService); | ||
} | ||
|
||
public void removeChannelTypesForThing(ThingUID uid) { | ||
String thingUid = uid.getAsString() + ":"; | ||
getChannelTypes(null).stream().map(ChannelType::getUID).filter(c -> c.getAsString().startsWith(thingUid)) | ||
.forEach(this::removeChannelType); | ||
} | ||
} |
Oops, something went wrong.