Skip to content

Commit

Permalink
[verisure] Avoid updates duplication after communication errors (open…
Browse files Browse the repository at this point in the history
…hab#13652)

Avoid registering several times the same device status listener.
It is called by the thing handler each time the bridge status changed to ONLINE.

Signed-off-by: Laurent Garnier <[email protected]>
  • Loading branch information
lolodomo authored and andan67 committed Nov 5, 2022
1 parent 91f8575 commit 25f5653
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

Expand Down Expand Up @@ -82,7 +82,7 @@ public class VerisureSession {
private final Map<String, VerisureThingHandler<?>> verisureHandlers = new ConcurrentHashMap<>();
private final Logger logger = LoggerFactory.getLogger(VerisureSession.class);
private final Gson gson = new Gson();
private final List<DeviceStatusListener<VerisureThingDTO>> deviceStatusListeners = new CopyOnWriteArrayList<>();
private final Set<DeviceStatusListener<VerisureThingDTO>> deviceStatusListeners = ConcurrentHashMap.newKeySet();
private final Map<BigDecimal, VerisureInstallation> verisureInstallations = new ConcurrentHashMap<>();
private static final List<String> APISERVERLIST = Arrays.asList("https://m-api01.verisure.com",
"https://m-api02.verisure.com");
Expand Down

0 comments on commit 25f5653

Please sign in to comment.