~hww3/org.openhab.binding.appletv

439db099b26e45da403d2751fab42a489388362e — H. William Welliver III 1 year, 8 months ago 7c3dc31
Dialing back some more log output to debug
1 files changed, 22 insertions(+), 22 deletions(-)

M src/main/java/org/openhab/binding/appletv/internal/AppleTVHandler.java
M src/main/java/org/openhab/binding/appletv/internal/AppleTVHandler.java => src/main/java/org/openhab/binding/appletv/internal/AppleTVHandler.java +22 -22
@@ 224,7 224,7 @@ public class AppleTVHandler extends BaseThingHandler {
        String result = pyATV.executeCommandLineAndWaitResponse(Duration.ofSeconds(15), args);

        if (result == null || !result.trim().equalsIgnoreCase(getThing().getProperties().get(PROPERTY_MAC_ADDRESS))) {
            logger.info("Pairing failed: " + result);
            logger.warn("Pairing failed: " + result);
            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR);
            shouldRunScanner = false;
            if (eventScanner != null) {


@@ 315,7 315,7 @@ public class AppleTVHandler extends BaseThingHandler {
    }

    Boolean receivedCommandResult(JsonElement element) {
        logger.info("Received command result: "
        logger.debug("Received command result: "
                + (logger.isDebugEnabled() ? element : StringUtils.truncate(element.toString(), 120)));
        JsonObject jsonObject = element.getAsJsonObject();
        if (jsonObject.has("exception")) {


@@ 338,10 338,10 @@ public class AppleTVHandler extends BaseThingHandler {
                if (jsonObject.has("state")) {
                    if ("complete".equals(jsonObject.get("state").getAsString())) {
                        airPlaying = false;
                        logger.info("Setting airPlaying to false");
                        logger.debug("Setting airPlaying to false");
                    } else if ("pending".equals(jsonObject.get("state").getAsString())) {
                        airPlaying = true;
                        logger.info("Setting airPlaying to true");
                        logger.debug("Setting airPlaying to true");
                    }
                }
            }


@@ 349,7 349,7 @@ public class AppleTVHandler extends BaseThingHandler {
                if (jsonObject.has("state")) {
                    if ("complete".equals(jsonObject.get("state").getAsString())) {
                        airPlaying = false;
                        logger.info("Setting airPlaying to false");
                        logger.debug("Setting airPlaying to false");
                        if (true == true)
                            return true;
                        if (streamingFiles.size() > 1)


@@ 366,7 366,7 @@ public class AppleTVHandler extends BaseThingHandler {
                        }
                    } else if ("pending".equals(jsonObject.get("state").getAsString())) {
                        airPlaying = true;
                        logger.info("Setting airPlaying to true");
                        logger.debug("Setting airPlaying to true");
                    }
                }
            }


@@ 380,7 380,7 @@ public class AppleTVHandler extends BaseThingHandler {
    }

    Boolean receivedEvent(JsonElement element) {
        logger.info("Received event: "
        logger.debug("Received event: "
                + (logger.isDebugEnabled() ? element : StringUtils.truncate(element.toString(), 2048)));
        JsonObject jsonObject = element.getAsJsonObject();
        if (jsonObject.has("power_state")) {


@@ 419,7 419,7 @@ public class AppleTVHandler extends BaseThingHandler {
    }

    void doUpdatePlaying(JsonObject jsonObject) {
        logger.info("Updating play status");
        logger.debug("Updating play status");

        doUpdate(jsonObject, PLAYSTATUS_STATE);
        doUpdate(jsonObject, PLAYSTATUS_REPEAT);


@@ 494,7 494,7 @@ public class AppleTVHandler extends BaseThingHandler {
            }
        }

        logger.info("Updating artwork");
        logger.debug("Updating artwork");
        updateChannel(PLAYSTATUS_ARTWORK, "", new RawType(Base64.getDecoder().decode(b64), mimeType));
    }



@@ 502,11 502,11 @@ public class AppleTVHandler extends BaseThingHandler {
        JsonElement s = jsonObject.get(field);
        if (s.isJsonNull()) {
            if (field.equals(PLAYSTATUS_POSITION)) {
                logger.info("Field " + field + " is null. Setting to zero.");
                logger.debug("Field " + field + " is null. Setting to zero.");
                statusEvent(field, "0");
                return;
            } else {
                logger.info("Field " + field + " is null. Setting to empty string.");
                logger.debug("Field " + field + " is null. Setting to empty string.");
                statusEvent(field, "");
                return;
            }


@@ 519,7 519,7 @@ public class AppleTVHandler extends BaseThingHandler {
        if (getThing().getStatus() != ThingStatus.ONLINE) {
        }

        logger.info(("Channel: " + channelUID + ", Command: " + command));
        logger.debug(("Channel: " + channelUID + ", Command: " + command));

        if (command instanceof RefreshType) {
            // TO-DO: handle data refresh


@@ 528,7 528,7 @@ public class AppleTVHandler extends BaseThingHandler {
            switch (channelUID.getIdWithoutGroup()) {
                case CHANNEL_REMOTE_KEY:
                    String keySequence = command.toString();
                    logger.info("Send key(s): {}", keySequence);
                    logger.debug("Send key(s): {}", keySequence);
                    switch (keySequence) {
                        case KEY_MOVIE:
                            keySequence = config.keyMovie;


@@ 547,23 547,23 @@ public class AppleTVHandler extends BaseThingHandler {
                    requestUpdates = UPDATE_SKIP_COUNT;
                    break;
                case CHANNEL_POSITION:
                    logger.info("Set position to {}", command.toString());
                    logger.debug("Set position to {}", command.toString());
                    setPosition(command.toString());
                    break;
                case CHANNEL_SHUFFLE:
                    logger.info("Set shuffle to {}", command.toString());
                    logger.debug("Set shuffle to {}", command.toString());
                    setShuffle(command.toString());
                    break;
                case CHANNEL_REPEAT_STATE:
                    logger.info("Set repeat to {}", command.toString());
                    logger.debug("Set repeat to {}", command.toString());
                    setRepeat(command.toString());
                    break;
                case CHANNEL_APP_IDENTIFIER:
                    logger.info("Launching app {}", command.toString());
                    logger.debug("Launching app {}", command.toString());
                    sendCommands(COMMAND_LAUNCH_APP + " " + command.toString());
                    break;
                case CHANNEL_POWER_STATUS:
                    logger.info("Set power to {}", command.toString());
                    logger.debug("Set power to {}", command.toString());
                    if (command == OnOffType.ON)
                        sendCommands(COMMAND_TURN_ON);
                    else


@@ 666,7 666,7 @@ public class AppleTVHandler extends BaseThingHandler {
                // requestUpdates++;
            }
        } else {
            logger.debug("Event property '{}' with value '{}' for unknown channel", prop, input);
            logger.info("Event property '{}' with value '{}' for unknown channel", prop, input);
        }
    }



@@ 850,7 850,7 @@ public class AppleTVHandler extends BaseThingHandler {
            return;
        }
        airPlaying = true;
        logger.info("Setting airPlaying to true");
        logger.debug("Setting airPlaying to true");

        sendCommands(command + " " + stringType.toString());
    }


@@ 867,7 867,7 @@ public class AppleTVHandler extends BaseThingHandler {
            return;
        }
        airPlaying = true;
        logger.info("Setting airPlaying to true");
        logger.debug("Setting airPlaying to true");
        sendCommands(command + " " + stringType.toString());
    }



@@ 888,7 888,7 @@ public class AppleTVHandler extends BaseThingHandler {
            return;
        }
        airPlaying = true;
        logger.info("Setting airPlaying to true");
        logger.debug("Setting airPlaying to true");
        streamingFiles.add(path);
        sendCommands(command + " " + path.toString());
    }