Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[freeboxos] Fix command handling for DECT thing type #17274

Merged
merged 3 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,11 @@ protected class ConfigResponse extends Response<Config> {
protected class StatusResponse extends Response<Status> {
}

private enum NetworkStatus {
WORKING,
UNKNOWN
}

public static record Config(NetworkStatus network, boolean dectEcoMode, String dectPin, int dectRingPattern,
public static record Config(String network, boolean dectEcoMode, String dectPin, int dectRingPattern,
boolean dectRegistration, boolean dectNemoMode, boolean dectEnabled, boolean dectRingOnOff) {
}

public enum Type {
FXS,
DECT,
UNKNOWN
}

public static record Status(int id, boolean isRinging, boolean onHook, boolean hardwareDefect, Type type,
public static record Status(int id, boolean isRinging, boolean onHook, boolean hardwareDefect, String type,
@Nullable String vendor, int gainRx, int gainTx) {

public String vendor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.freeboxos.internal.api.rest.PhoneManager.Status;
import org.openhab.binding.freeboxos.internal.api.rest.PhoneManager.Type;
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
import org.openhab.core.thing.ThingUID;
import org.slf4j.Logger;
Expand Down Expand Up @@ -44,7 +43,7 @@ public static PhoneConfigurationBuilder getInstance() {
public DiscoveryResultBuilder configure(ThingUID bridgeUID, Status config) {
ThingUID thingUID;
String label;
if (Type.DECT.equals(config.type())) {
if ("dect".equalsIgnoreCase(config.type())) {
thingUID = new ThingUID(THING_TYPE_DECT, bridgeUID, Integer.toString(config.id()));
label = "DECT Phone";
} else {
Expand Down