Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
fix: test build (Arduino code)
  • Loading branch information
StellaLupus committed Aug 10, 2024
1 parent 08f1962 commit 3419ea3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
8 changes: 8 additions & 0 deletions src/ir_Electrolux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ void IRElectroluxAc::setTemp(const uint8_t degrees)
{
uint8_t temp = max(kElectroluxAcMinTemp, degrees);
temp = min(kElectroluxAcMaxTemp, temp);
#ifndef UNIT_TEST
temp = map(temp, kElectroluxAcMinTemp, kElectroluxAcMaxTemp, kElectroluxAcMinFTemp, kElectroluxAcMaxFTemp);
#else
temp = temp * 9 / 5 + 32;
#endif
_.Temp = temp - kElectroluxAcMinFTemp;
}
}
Expand All @@ -169,7 +173,11 @@ uint8_t IRElectroluxAc::getTemp(void) const
}
else
{
#ifndef UNIT_TEST
uint8_t temp = map(_.Temp + kElectroluxAcMinFTemp, kElectroluxAcMinFTemp, kElectroluxAcMaxFTemp, kElectroluxAcMinTemp, kElectroluxAcMaxTemp);
#else
uint8_t temp = ((_.Temp + kElectroluxAcMinFTemp) - 32) * 5 / 9;
#endif
return temp;
}
}
Expand Down
21 changes: 5 additions & 16 deletions tools/serial_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@


def substring_after(str: str, searchStr: str):
return str[str.index(searchStr) + len(searchStr) :]
return str[str.index(searchStr) + len(searchStr):]


def getPort():
ports = sorted(serial.tools.list_ports.comports())
print("Available ports to listing:")
for id, portInfo in enumerate(ports):
print(
"{}. - {}: {} [{}]".format(
id, portInfo.device, portInfo.description, portInfo.hwid
)
)
print("{}. - {}: {} [{}]".format(id, portInfo.device,
portInfo.description, portInfo.hwid))
print("Select port: ", end="")
selectId = int(input())
if selectId < len(ports) and selectId >= 0:
Expand Down Expand Up @@ -71,9 +68,8 @@ def main():
continue
# print(dataStr)
if "uint16_t rawData" in dataStr:
dataStrArray = str(
dataStr[dataStr.index("{") + 1 : dataStr.index("}")]
).split(",")
dataStrArray = str(dataStr[dataStr.index("{") +
1:dataStr.index("}")]).split(",")
data = [int(i.strip()) for i in dataStrArray]
data = data[2:]
clearData = [i for idi, i in enumerate(data) if idi % 2 == 1]
Expand All @@ -92,13 +88,6 @@ def main():
oSum += d
oCnt += 1

# print("zero = " + str(zSum/zCnt) + " one = " + str(oSum/oCnt) + " space = " + str(sSum/sCnt))\

# print("Data = ", end="")
# print(data)
# print("0b"+ "".join([str(i) for i in bitData]))
# print("ClearData = ", end="")
# print(clearData)
print("".join([str(i) for i in clearBitData]))


Expand Down

0 comments on commit 3419ea3

Please sign in to comment.