Package org.openhab.binding.sonos

Examples of org.openhab.binding.sonos.SonosBindingProvider


   * @return the matching binding provider or <code>null</code> if no binding
   *         provider could be found
   */
  protected SonosBindingProvider findFirstMatchingBindingProvider(
      String itemName) {
    SonosBindingProvider firstMatchingProvider = null;
    for (SonosBindingProvider provider : providers) {
      List<String> sonosIDs = provider.getSonosID(itemName);
      if (sonosIDs != null && sonosIDs.size() > 0) {
        firstMatchingProvider = provider;
        break;
View Full Code Here


  }

  @Override
  protected void internalReceiveCommand(String itemName, Command command) {

    SonosBindingProvider provider = findFirstMatchingBindingProvider(itemName);
    String commandAsString = command.toString();

    if (command != null) {

      List<Command> commands = new ArrayList<Command>();

      if (command instanceof StringType || command instanceof DecimalType) {
        commands = provider.getVariableCommands(itemName);
      } else {
        commands.add(command);
      }

      for (Command someCommand : commands) {

        String sonosID = provider.getSonosID(itemName, someCommand);
        String sonosCommand = provider.getSonosCommand(itemName,someCommand);
        SonosCommandType sonosCommandType = null;

        try {
          sonosCommandType = SonosCommandType.getCommandType(sonosCommand, Direction.OUT);
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.openhab.binding.sonos.SonosBindingProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.