Search in sources :

Example 1 with ZoneStatus

use of org.openhab.binding.denon.internal.communication.entities.ZoneStatus in project openhab1-addons by openhab.

the class DenonConnector method updateMainZone.

private void updateMainZone() {
    String url = statusUrl + URL_ZONE_MAIN;
    logger.trace("Refreshing URL: {}", url);
    ZoneStatus mainZone = getDocument(url, ZoneStatus.class);
    if (mainZone != null) {
        stateCache.put(DenonProperty.INPUT.getCode(), new StringType(mainZone.getInputFuncSelect().getValue()));
        stateCache.put("SI" + mainZone.getInputFuncSelect().getValue(), OnOffType.ON);
        stateCache.put(DenonProperty.MASTER_VOLUME.getCode(), new PercentType(mainZone.getMasterVolume().getValue()));
        stateCache.put(DenonProperty.POWER_MAINZONE.getCode(), mainZone.getPower().getValue() ? OnOffType.ON : OnOffType.OFF);
        stateCache.put(DenonProperty.MUTE.getCode(), mainZone.getMute().getValue() ? OnOffType.ON : OnOffType.OFF);
        if (mainZone.getSurrMode() == null) {
            logger.debug("Unable to get the SURROUND_MODE. MainZone update may not be correct.");
        } else {
            stateCache.put(DenonProperty.SURROUND_MODE.getCode(), new StringType(mainZone.getSurrMode().getValue()));
        }
    }
}
Also used : StringType(org.openhab.core.library.types.StringType) ZoneStatus(org.openhab.binding.denon.internal.communication.entities.ZoneStatus) PercentType(org.openhab.core.library.types.PercentType)

Aggregations

ZoneStatus (org.openhab.binding.denon.internal.communication.entities.ZoneStatus)1 PercentType (org.openhab.core.library.types.PercentType)1 StringType (org.openhab.core.library.types.StringType)1