/* (non-Javadoc)
   * @see org.openhab.binding.digitalSTROM2.internal.client.job.SensorJob#execute(org.openhab.binding.digitalSTROM2.internal.client.DigitalSTROMAPI, java.lang.String)
   */
  @Override
  public void execute(DigitalSTROMAPI digitalSTROM, String token) {
    DeviceConfig config =
        digitalSTROM.getDeviceConfig(
            token, this.device.getDSID(), null, DeviceParameterClassEnum.CLASS_128, this.sceneId);

    if (config != null) {
      this.device.setSceneOutputValue(this.sceneId, (short) config.getValue());
      logger.info(
          "UPDATED sceneOutputValue for dsid: "
              + this.device.getDSID()
              + ", sceneID: "
              + sceneId
              + ", value: "
              + config.getValue());
    }
  }
  /*
   * (non-Javadoc)
   *
   * @see org.openhab.binding.digitalSTROM2.internal.client.job.SensorJob#execute(org.openhab.binding.digitalSTROM2.
   * internal.client.DigitalSTROMAPI, java.lang.String)
   */
  @Override
  public void execute(DigitalSTROMAPI digitalSTROM, String token) {
    int consumption =
        digitalSTROM.getDeviceSensorValue(token, this.device.getDSID(), null, this.sensorIndex);
    logger.info(
        "DeviceConsumption : " + consumption + ", DSID: " + this.device.getDSID().getValue());

    switch (this.sensorIndex) {
      case ACTIVE_POWER:
        this.device.setPowerConsumption(consumption);
        break;
      case OUTPUT_CURRENT:
        this.device.setElectricMeterValue(consumption);
        break;
      default:
        break;
    }
  }