Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -12,6 +12,8 @@
*/
package org.openhab.binding.hue.internal;

import static org.openhab.core.thing.ChannelUID.CHANNEL_GROUP_SEPARATOR;

import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -145,6 +147,8 @@ public class HueBindingConstants {
public static final ThingTypeUID THING_TYPE_AREA = new ThingTypeUID(BINDING_ID, "area");
public static final ThingTypeUID THING_TYPE_SERVICE_GROUP = new ThingTypeUID(BINDING_ID, "service-group");

public static final String CHANNEL_GROUP_SOFTWARE = "software";

// channels for API v2
public static final String CHANNEL_2_COLOR = CHANNEL_COLOR;
public static final String CHANNEL_2_COLOR_TEMP_PERCENT = "color-temperature";
Expand Down Expand Up @@ -188,7 +192,8 @@ public class HueBindingConstants {
public static final String CHANNEL_2_MOTION_AREA_ENABLED = "motion-area-enabled";
public static final String CHANNEL_2_SECURITY_MOTION = "security-motion";
public static final String CHANNEL_2_SECURITY_MOTION_LAST_UPDATED = "security-motion-last-updated";
public static final String CHANNEL_2_UPDATE_READY_TO_INSTALL = "update-ready";
public static final String CHANNEL_2_UPDATE_READY_TO_INSTALL = //
Comment thread
andrewfg marked this conversation as resolved.
CHANNEL_GROUP_SOFTWARE + CHANNEL_GROUP_SEPARATOR + "update-ready";

// channel IDs that (optionally) support dynamics
public static final Set<String> DYNAMIC_CHANNELS = Set.of(CHANNEL_2_BRIGHTNESS, CHANNEL_2_COLOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public class Clip2BridgeHandler extends BaseBridgeHandler {
private Map<Integer, Future<?>> resourcesEventTasks = new ConcurrentHashMap<>();

private boolean assetsLoaded;
private boolean softwareUpdateReadyNotificationSent;
Comment thread
andrewfg marked this conversation as resolved.
Outdated
private int applKeyRetriesRemaining;
private int connectRetriesRemaining;

Expand Down Expand Up @@ -517,6 +518,7 @@ public void initialize() {
applKeyRetriesRemaining = APPLICATION_KEY_MAX_TRIES;
connectRetriesRemaining = RECONNECT_MAX_TRIES;
initializeAssets();
softwareUpdateReadyNotificationSent = false;
}

/**
Expand Down Expand Up @@ -959,7 +961,10 @@ private UpdateStatusV2 refreshSoftwareStatusUI() {
updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, description);
break;
case READY_TO_INSTALL:
triggerChannel(CHANNEL_2_UPDATE_READY_TO_INSTALL);
if (!softwareUpdateReadyNotificationSent) {
softwareUpdateReadyNotificationSent = true;
triggerChannel(CHANNEL_2_UPDATE_READY_TO_INSTALL);
}
Comment thread
andrewfg marked this conversation as resolved.
// note: fall through to set Thing status, status detail, and status description
case INSTALL_FAILED:
default:
Expand Down
Loading