allow piir config having multiple bin sets, so selecting between different tv remotes would be easy
This commit is contained in:
parent
a28da85ec4
commit
bd35259111
2 changed files with 9 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ import java.io.InputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
@ -114,7 +115,8 @@ public class PiIR implements TaskProcess {
|
||||||
this.exec = config.exec;
|
this.exec = config.exec;
|
||||||
this.gpio = config.gpio;
|
this.gpio = config.gpio;
|
||||||
|
|
||||||
for (var bind : config.binds) {
|
List<PiIRBindItem> bindSet = config.bindSet.get(config.currentBindSet);
|
||||||
|
for (var bind : bindSet) {
|
||||||
binds.put(formatBindKey(bind.preData, bind.data), bind.menuAction);
|
binds.put(formatBindKey(bind.preData, bind.data), bind.menuAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.mykola2312.mptv.piir;
|
package com.mykola2312.mptv.piir;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
|
|
@ -10,6 +11,9 @@ public class PiIRConfig {
|
||||||
|
|
||||||
public int gpio;
|
public int gpio;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public List<PiIRBindItem> binds;
|
public String currentBindSet;
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public Map<String, List<PiIRBindItem>> bindSet;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue