fix(cpn): set input and switch types to none if not configured (#5026)

This commit is contained in:
Neil Horne
2024-05-24 18:07:14 +10:00
committed by GitHub
parent d21ac7be2c
commit fae3f8384b
3 changed files with 44 additions and 31 deletions
@@ -365,15 +365,6 @@ bool convert<YamlSwitchConfig>::decode(const Node& node, YamlSwitchConfig& rhs)
const int maxcnt = Boards::getCapability(board, Board::Switches);
// load defaults in case values not in yaml file
for (int i = 0; i < maxcnt; i++) {
Board::SwitchInfo info = Boards::getSwitchInfo(i, board);
rhs.config[i].tag = info.tag;
memset(rhs.config[i].name, 0, sizeof(rhs.config[i].name));
rhs.config[i].type = info.dflt;
rhs.config[i].inverted = info.inverted;
}
for (const auto& kv : node) {
std::string tag;
kv.first >> tag;