Eliminate risk of bad firmware response breaking shade/scene updates. (#12214)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2022-02-05 21:23:36 +01:00 committed by GitHub
parent b9a838bf18
commit e9deeccf49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,6 +170,7 @@ public class HDPowerViewHubHandler extends BaseBridgeHandler {
hardRefreshPositionInterval = config.hardRefresh;
hardRefreshBatteryLevelInterval = config.hardRefreshBatteryLevel;
initializeChannels();
firmwareVersions = null;
schedulePoll();
}
@ -282,8 +283,13 @@ public class HDPowerViewHubHandler extends BaseBridgeHandler {
private synchronized void poll() {
try {
logger.debug("Polling for state");
updateFirmwareProperties();
} catch (HubException e) {
logger.warn("Failed to update firmware properties: {}", e.getMessage());
}
try {
logger.debug("Polling for state");
pollShades();
List<Scene> scenes = updateSceneChannels();