[IR] universal remote additions (#3922)

* multiple new additions
  Hisense K321UW, Soniq E55V13A, Soniq E32W13B and 2 others
* updated with proper names
  Viano STV65UHD4K
  Hisense K321UW
  Hisense EN2B27
  Soniq E55V13A
  Soniq E32W13B
* format tv.ir
* Update tv.ir
* new universal ac additions
  Maytag M6X06F2A
  Panasonic CS-E9HKR
* new universal audio additions
  Sony MHC_GSX75
  Elac EA101EQ-G
  Philips FW750C
  Pioneer VSX-D1-S
* remove final # audio.ir
* Scripts: update deprecated methods use in python scripts
* Scripts: add comment reading support to fff, preserve comments in infrared cleanup script
* Scripts: improved infrared files cleanup script
* Scripts: add missing new line at the end of file in infrared file cleanup script
* Infrared: cleanup universal remotes

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
jay candel 2024-10-03 00:28:24 +08:00 committed by GitHub
parent 09a7cc2b46
commit 3c93761d1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 345 additions and 190 deletions

View file

@ -896,3 +896,49 @@ type: raw
frequency: 38000
duty_cycle: 0.330000
data: 4388 4399 572 1583 573 532 546 1585 571 1583 574 503 575 505 573 1584 572 504 574 505 573 1584 573 506 572 504 573 1584 573 1584 572 505 574 1611 545 506 573 1583 573 1585 571 1586 545 1609 547 531 547 1611 545 1608 548 1607 549 530 548 529 548 531 548 532 546 1610 546 533 545 530 547 1609 547 1610 547 1609 547 533 545 529 548 530 548 530 547 531 546 530 547 530 548 533 544 1608 548 1608 548 1610 546 1606 550 1609 547 5203 4388 4397 548 1609 547 531 547 1608 548 1608 548 530 548 530 548 1608 548 531 547 531 547 1610 546 531 547 530 548 1609 547 1611 546 532 547 1609 547 531 547 1608 548 1610 546 1609 547 1608 548 530 547 1609 547 1608 548 1609 547 531 546 530 548 530 547 530 547 1608 548 532 547 534 545 1608 548 1608 548 1609 547 530 548 531 547 531 547 532 546 531 546 531 547 532 546 530 548 1608 547 1608 548 1610 546 1608 548 1608 548
#
# Model: Panasonic CS-E9HKR
#
name: Dh
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 3466 1748 445 367 502 1292 444 422 444 420 445 422 443 420 445 421 445 420 445 363 503 420 445 422 444 420 445 424 445 1292 445 421 445 451 414 421 444 421 444 421 445 422 443 423 446 1292 443 1292 445 1292 445 421 497 372 444 1293 445 420 445 421 444 421 444 421 445 421 444 421 444 420 445 422 444 420 445 421 444 421 444 421 445 422 443 356 509 420 445 421 445 429 436 421 444 421 444 414 452 420 445 421 444 421 444 423 443 421 444 421 444 421 444 423 443 420 445 424 445 1291 444 1294 444 421 444 421 444 421 444 422 444 423 445 9989 3463 1752 444 424 445 1293 443 422 444 392 473 421 444 416 449 423 443 421 444 421 444 421 444 423 443 422 443 425 444 1292 444 423 443 422 443 419 446 421 444 423 443 421 444 426 443 1292 444 1294 443 1294 443 421 444 425 444 1294 444 422 443 421 444 422 443 424 442 421 444 421 444 421 444 423 444 421 444 422 443 421 444 423 443 425 444 1293 444 421 444 421 444 1293 444 423 446 1292 445 321 546 421 444 421 444 385 480 423 443 425 444 1291 445 1293 443 422 445 422 443 421 444 421 496 370 444 422 443 421 496 370 443 421 444 1291 497 1239 444 1284 504 1237 447 1293 444 425 444 1293 496 371 494 1241 495 370 496 369 497 297 517 421 496 370 495 369 496 370 496 370 495 370 495 369 496 372 494 370 495 369 496 370 495 370 496 370 495 373 495 1240 495 1241 495 1240 497 369 496 371 494 371 443 422 496 369 496 368 497 370 496 369 496 372 497 1239 496 1241 496 1241 496 370 495 310 555 371 495 371 494 368 497 370 495 370 496 361 504 370 495 369 496 372 494 372 494 369 496 371 494 371 495 373 495 1240 497 370 495 371 495 370 495 369 496 370 495 370 495 1242 495 373 492 370 495 366 500 369 496 371 495 370 495 371 495 369 496 371 494 370 495 371 495 371 494 371 494 370 495 372 494 380 488 1241 496 374 495 1241 495 1240 495 1240 495 1241 495 1242 494 1244 494
#
name: Cool_hi
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 3467 1751 442 425 444 1294 443 424 442 422 443 423 442 422 443 422 444 421 444 421 444 424 441 423 443 421 444 425 444 1294 443 424 442 423 442 422 443 425 440 423 443 423 442 427 442 1292 443 1322 415 1293 444 422 443 425 443 1295 443 424 441 421 444 423 442 424 442 425 440 423 442 423 442 424 442 292 573 421 444 423 442 422 444 422 443 422 443 423 442 425 441 423 442 425 440 421 444 424 442 422 443 422 443 422 443 424 442 422 443 422 443 422 443 424 442 421 444 426 443 1292 443 1294 444 423 442 422 443 423 442 424 442 426 442 9989 3465 1753 442 425 444 1292 445 424 442 424 441 421 444 422 443 422 444 423 442 423 442 352 513 423 443 423 442 425 443 1296 441 423 443 422 443 422 443 424 441 423 443 422 443 427 442 1293 442 1322 415 1293 444 421 444 425 443 1294 444 422 443 422 443 421 444 425 441 423 442 422 443 421 444 423 443 421 444 422 443 422 443 424 442 425 444 1261 475 422 443 422 443 1292 444 1293 442 1295 441 424 442 422 443 422 443 427 442 1322 415 1292 444 1292 444 1294 442 423 443 422 443 421 444 422 443 423 443 421 444 421 444 423 442 421 444 1291 444 1293 443 1294 442 1195 541 1293 444 425 443 1293 443 422 444 1322 414 421 444 422 443 423 443 422 443 423 442 422 443 425 441 422 443 422 443 423 442 423 443 422 443 422 443 421 444 423 444 421 444 424 444 1292 444 1293 444 1294 442 422 443 421 444 423 443 422 443 421 444 422 443 424 442 421 444 426 443 1291 444 1293 443 1293 444 422 443 421 444 422 444 421 444 422 443 421 444 423 443 423 442 421 444 422 443 423 444 421 444 421 444 421 444 422 444 425 444 1294 443 422 443 423 444 424 441 422 443 422 443 422 443 1294 443 422 443 421 444 424 442 421 444 413 452 421 444 423 443 421 444 422 443 422 443 422 444 421 444 422 443 422 443 423 443 426 443 1294 442 421 444 423 442 1293 443 1293 443 421 444 422 444 362 505
#
name: Cool_lo
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 3467 1751 444 424 444 1291 446 422 444 420 445 420 445 419 446 421 445 378 487 421 444 420 445 420 446 421 444 423 446 1321 415 451 415 420 445 420 445 419 446 421 445 419 446 422 447 1290 445 1291 445 1291 446 420 445 424 445 1293 445 420 445 420 445 420 445 421 445 420 445 420 445 419 446 421 445 420 445 421 444 420 445 421 445 420 445 420 445 420 445 421 445 419 446 420 445 420 445 420 446 420 445 421 444 419 446 422 444 420 445 420 445 421 444 421 445 421 444 424 445 1290 445 1292 446 420 445 421 444 420 445 423 443 424 444 9988 3465 1751 446 423 445 1291 446 421 445 420 445 420 445 420 445 422 444 420 445 420 445 421 444 421 446 421 444 424 445 1291 446 421 445 421 444 420 445 420 445 420 446 421 444 423 446 1291 444 1293 444 1292 445 420 445 423 446 1294 444 419 446 420 445 421 444 422 444 420 445 421 444 420 445 421 445 421 444 420 445 420 445 422 444 421 444 420 445 420 445 421 444 1320 415 1291 445 1292 444 422 444 420 445 419 446 420 445 421 445 421 444 424 445 1291 446 421 445 420 445 420 445 421 444 421 445 421 444 421 444 420 445 420 445 1291 445 1292 443 1290 445 1291 446 1292 445 424 444 1293 444 421 444 1292 445 422 443 421 444 381 485 420 445 420 445 420 445 422 444 421 444 420 445 421 444 421 445 421 444 421 444 420 445 421 445 421 444 424 445 1291 444 1292 445 1291 446 420 445 419 446 422 444 421 444 420 445 420 445 421 445 420 445 423 446 1291 444 1291 446 1292 445 420 445 420 445 422 444 420 445 420 445 420 445 422 444 421 444 420 445 419 446 420 446 420 445 419 446 419 446 421 445 423 445 1293 444 419 446 421 445 420 445 419 446 420 445 420 445 1292 445 420 445 420 445 421 445 420 445 419 446 419 446 420 446 419 446 420 445 420 445 420 446 420 445 420 445 420 445 421 445 419 446 420 445 423 446 1292 445 1290 445 1290 445 1292 444 1291 445 1293 445
#
name: Heat_hi
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 3463 1751 443 424 445 1293 443 422 444 420 445 421 444 421 444 422 444 421 444 421 444 421 444 353 513 422 443 425 444 1293 444 422 444 421 444 420 445 421 444 422 444 421 444 425 444 1291 444 1294 443 1293 444 421 444 424 445 1294 444 420 445 421 444 416 449 422 444 421 444 421 444 421 444 422 444 420 445 421 444 422 443 422 444 421 444 421 444 420 445 373 493 420 445 421 444 420 445 422 444 420 445 422 443 421 444 422 444 421 444 421 444 422 443 421 445 421 444 424 445 1291 444 1294 444 421 444 420 445 420 445 422 444 424 444 9991 3463 1751 445 425 444 1293 444 422 444 421 444 420 445 421 444 423 443 421 444 421 444 421 444 422 444 421 444 424 445 1293 444 422 444 420 445 422 443 421 444 424 442 421 444 425 444 1292 443 1292 445 1292 445 421 444 424 445 1293 445 421 444 421 444 421 444 422 444 421 444 421 444 422 443 422 444 423 442 421 444 423 442 423 443 425 443 1293 444 423 442 421 444 1292 444 422 443 425 443 1295 443 421 444 368 549 373 443 1293 496 1240 495 1240 495 1241 496 371 495 370 495 370 495 370 495 371 495 370 495 369 496 371 494 371 494 1240 442 1293 495 1240 496 1241 496 1240 497 373 496 1241 496 371 494 1184 553 370 495 370 495 370 496 370 443 423 494 370 443 424 495 370 442 423 442 422 443 424 442 423 442 423 442 425 440 424 442 424 441 427 442 1294 441 1294 443 1294 443 424 441 423 442 425 442 421 444 423 442 424 441 425 441 424 441 426 443 1293 442 1295 442 1295 441 424 441 394 471 425 441 423 442 423 442 424 441 424 442 424 441 423 442 423 442 424 442 423 442 424 441 423 442 424 442 428 440 1295 442 424 441 425 441 424 441 424 441 423 442 424 441 1294 443 424 441 424 441 424 442 423 442 423 442 423 442 425 441 424 441 424 441 424 441 424 442 424 441 449 416 423 442 424 442 427 442 1295 442 424 441 424 441 1295 442 427 442 1295 441 425 441 426 441
#
name: Heat_lo
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 3461 1753 439 429 440 1298 439 427 439 426 439 426 439 426 439 427 439 426 439 426 439 426 439 427 439 426 439 430 438 1298 438 428 438 426 439 427 438 427 438 427 439 427 438 430 414 1321 439 1299 413 1323 414 451 414 455 414 1324 414 452 413 451 414 453 413 436 430 452 413 452 413 451 414 453 413 452 413 451 414 452 413 454 412 452 413 452 413 452 413 453 413 452 413 452 413 452 413 454 413 453 412 452 413 452 413 453 413 452 413 452 413 452 413 453 413 452 413 456 412 1323 412 1325 413 452 413 453 412 453 412 454 412 455 390 10044 3438 1779 412 457 412 1324 413 454 412 453 412 453 412 453 412 454 412 453 412 453 412 454 411 455 411 453 412 457 389 1347 390 477 389 476 389 476 389 476 389 402 465 475 390 479 390 1346 389 1348 389 1347 390 476 389 479 390 1348 390 476 389 476 389 476 389 477 389 475 390 476 389 476 389 477 389 476 389 476 389 476 389 478 388 480 389 1347 390 475 390 476 389 1347 390 476 389 479 389 1349 389 476 389 476 389 476 389 477 389 476 389 479 390 1348 389 477 389 476 389 476 389 476 389 476 390 476 389 476 389 476 389 476 389 1346 389 1347 389 1346 389 1347 390 1346 390 479 390 1347 390 476 389 1374 363 474 415 454 388 480 386 475 414 454 387 474 391 476 414 455 387 473 392 476 414 453 389 476 389 475 390 475 390 476 390 476 390 479 389 1346 389 1347 390 1348 389 476 389 476 389 477 389 476 389 476 389 475 390 477 389 440 425 479 389 1345 390 1347 390 1347 390 476 389 475 390 477 389 476 389 476 389 476 389 477 389 476 389 476 389 475 390 477 389 476 389 476 389 476 389 477 389 479 390 1347 390 476 389 477 389 476 389 476 389 476 389 476 389 1347 390 476 389 476 389 477 389 503 362 476 389 476 389 477 389 475 390 476 389 476 389 477 389 476 389 476 389 476 389 477 389 479 389 1347 390 479 390 1347 390 1348 389 476 389 476 389 477 389 477 390
#
name: Off
type: raw
frequency: 38000
duty_cycle: 0.330000
data: 3489 1725 493 375 493 1167 569 375 491 373 492 372 493 374 492 373 493 372 493 373 442 423 492 375 493 372 492 378 490 1245 443 423 493 374 491 375 490 374 442 424 492 374 491 379 440 1293 492 1245 443 1294 442 423 491 379 441 1296 491 375 441 423 442 423 442 425 441 423 442 425 440 424 441 425 441 424 441 421 444 424 441 425 441 423 442 423 442 423 442 453 413 424 442 451 414 424 441 426 440 424 441 424 441 424 441 425 441 424 441 424 441 424 441 426 440 425 440 427 442 1322 413 1296 442 424 441 423 442 424 441 424 442 427 441 9994 3463 1755 440 428 441 1296 441 426 440 425 440 426 439 425 440 426 440 423 442 425 440 425 440 372 494 425 440 428 440 1297 440 426 440 425 440 426 439 426 439 427 439 425 440 429 439 1297 439 1297 439 1297 440 426 439 429 440 1299 439 426 439 426 439 428 437 427 439 426 439 426 439 427 438 427 439 427 438 427 438 427 438 429 437 427 414 451 414 451 414 418 447 1323 414 452 413 455 414 1325 413 452 413 452 413 452 413 453 413 452 413 456 413 1324 413 453 413 452 413 453 412 452 413 454 412 453 412 453 412 453 412 452 413 1324 412 1323 412 1324 412 1324 412 1325 412 456 413 1324 412 404 461 1325 412 453 412 453 412 454 412 453 412 453 412 454 411 455 411 453 412 453 412 453 412 454 412 453 412 453 412 453 412 454 413 453 412 457 412 1323 413 1324 413 1324 412 453 412 453 412 454 413 453 412 453 412 453 412 454 412 452 413 456 412 1323 413 1324 413 1323 414 453 412 452 413 453 413 452 413 452 413 452 413 453 413 450 415 452 413 452 413 453 413 452 413 451 439 427 438 428 439 430 439 1298 439 426 439 428 438 426 439 428 437 426 439 427 438 1298 439 427 438 426 439 427 439 426 439 426 439 425 440 427 440 426 439 426 439 426 439 425 441 426 439 425 440 425 440 427 439 426 439 425 440 429 439 1297 440 1297 440 425 440 425 440 426 441 427 440
#
# Model: Maytag M6X06F2A
#
name: Off
type: parsed
protocol: NEC
address: 20 00 00 00
command: 02 00 00 00

View file

@ -1,7 +1,7 @@
Filetype: IR library file
Version: 1
#
# Model: NoName Unknown Audio remote
# Model: Yamaha RAV15 and NoName Unknown Audio remote
name: Play
type: parsed
protocol: NEC
@ -69,37 +69,6 @@ protocol: NECext
address: 84 79 00 00
command: 02 FD 00 00
#
# Model: Yamaha RAV15
name: Play
type: parsed
protocol: NEC
address: 00 00 00 00
command: 43 00 00 00
#
name: Vol_up
type: parsed
protocol: NEC
address: 00 00 00 00
command: 15 00 00 00
#
name: Vol_dn
type: parsed
protocol: NEC
address: 00 00 00 00
command: 07 00 00 00
#
name: Next
type: parsed
protocol: NEC
address: 00 00 00 00
command: 40 00 00 00
#
name: Prev
type: parsed
protocol: NEC
address: 00 00 00 00
command: 44 00 00 00
#
# Model: Yamaha RX-V375
name: Power
type: parsed
@ -506,3 +475,95 @@ type: parsed
protocol: SIRC20
address: 3A 07 00 00
command: 39 00 00 00
#
# Model: Sony MHC_GSX75
#
name: Pause
type: parsed
protocol: SIRC20
address: 3A 07 00 00
command: 38 00 00 00
#
# Model: Elac EA101EQ-G
#
name: Vol_up
type: parsed
protocol: NEC
address: 00 00 00 00
command: 46 00 00 00
#
name: Vol_dn
type: parsed
protocol: NEC
address: 00 00 00 00
command: 16 00 00 00
#
name: Power
type: parsed
protocol: NEC
address: 00 00 00 00
command: 18 00 00 00
#
name: Mute
type: parsed
protocol: NEC
address: 00 00 00 00
command: 55 00 00 00
#
# Model: Philips FW750C
#
name: Vol_up
type: parsed
protocol: RC5
address: 10 00 00 00
command: 10 00 00 00
#
name: Vol_dn
type: parsed
protocol: RC5
address: 10 00 00 00
command: 11 00 00 00
#
name: Play
type: parsed
protocol: RC5
address: 14 00 00 00
command: 35 00 00 00
#
name: Pause
type: parsed
protocol: RC5
address: 14 00 00 00
command: 36 00 00 00
#
name: Mute
type: parsed
protocol: RC5
address: 10 00 00 00
command: 0D 00 00 00
#
name: Power
type: parsed
protocol: RC5
address: 14 00 00 00
command: 0C 00 00 00
#
# Model: Pioneer VSX-D1-S
#
name: Vol_up
type: parsed
protocol: NECext
address: 00 7F 00 00
command: 0A F5 00 00
#
name: Mute
type: parsed
protocol: NECext
address: 00 7F 00 00
command: 5C A3 00 00
#
name: Power
type: parsed
protocol: NECext
address: 00 7F 00 00
command: 1E E1 00 00

View file

@ -360,12 +360,6 @@ protocol: NECext
address: 33 00 00 00
command: 0B F4 00 00
#
name: Power
type: parsed
protocol: NECext
address: 83 55 00 00
command: 90 6F 00 00
#
name: Vol_dn
type: parsed
protocol: NECext
@ -738,12 +732,6 @@ protocol: NEC
address: 00 00 00 00
command: 8C 00 00 00
#
name: Power
type: parsed
protocol: NECext
address: 87 45 00 00
command: 17 E8 00 00
#
name: Vol_up
type: raw
frequency: 38000

View file

@ -1687,14 +1687,6 @@ protocol: NEC
address: 40 00 00 00
command: 10 00 00 00
#
# Philips OLED 934/12
#
name: Power
type: parsed
protocol: RC6
address: 00 00 00 00
command: 0C 00 00 00
#
name: Mute
type: parsed
protocol: RC6
@ -1725,44 +1717,6 @@ protocol: RC6
address: 00 00 00 00
command: 21 00 00 00
#
# Model TCL 50P715X1
#
name: Power
type: parsed
protocol: RCA
address: 0F 00 00 00
command: 54 00 00 00
#
name: Mute
type: parsed
protocol: RCA
address: 0F 00 00 00
command: FC 00 00 00
#
name: Vol_up
type: parsed
protocol: RCA
address: 0F 00 00 00
command: F4 00 00 00
#
name: Vol_dn
type: parsed
protocol: RCA
address: 0F 00 00 00
command: 74 00 00 00
#
name: Ch_next
type: parsed
protocol: RCA
address: 0F 00 00 00
command: B4 00 00 00
#
name: Ch_prev
type: parsed
protocol: RCA
address: 0F 00 00 00
command: 34 00 00 00
#
# Model: JTC Genesis 5.5
#
name: Mute
@ -1829,26 +1783,6 @@ protocol: NEC
address: 01 00 00 00
command: 17 00 00 00
#
# Visio TV
#
name: Power
type: parsed
protocol: NEC
address: 04 00 00 00
command: 08 00 00 00
#
name: Vol_up
type: parsed
protocol: NEC
address: 04 00 00 00
command: 02 00 00 00
#
name: Vol_dn
type: parsed
protocol: NEC
address: 04 00 00 00
command: 03 00 00 00
#
name: Ch_next
type: parsed
protocol: NEC
@ -1861,12 +1795,6 @@ protocol: NEC
address: 04 00 00 00
command: 01 00 00 00
#
name: Mute
type: parsed
protocol: NEC
address: 04 00 00 00
command: 09 00 00 00
#
# Emerson TV
#
name: Power
@ -1942,4 +1870,111 @@ type: parsed
protocol: NECext
address: EA C7 00 00
command: 33 CC 00 00
#
# Model: Soniq E32W13B
#
name: Power
type: parsed
protocol: NECext
address: 72 DD 00 00
command: 0E F1 00 00
#
name: Mute
type: parsed
protocol: NECext
address: 72 DD 00 00
command: 1A E5 00 00
#
name: Vol_up
type: parsed
protocol: NECext
address: 72 DD 00 00
command: 49 B6 00 00
#
name: Vol_dn
type: parsed
protocol: NECext
address: 72 DD 00 00
command: 43 BC 00 00
#
name: Ch_next
type: parsed
protocol: NECext
address: 72 DD 00 00
command: 51 AE 00 00
#
name: Ch_prev
type: parsed
protocol: NECext
address: 72 DD 00 00
command: 4D B2 00 00
#
# Model: Hisense EN2B27
#
name: Power
type: parsed
protocol: NECext
address: 00 BF 00 00
command: 0D F2 00 00
#
name: Mute
type: parsed
protocol: NECext
address: 00 BF 00 00
command: 0E F1 00 00
#
name: Vol_up
type: parsed
protocol: NECext
address: 00 BF 00 00
command: 44 BB 00 00
#
name: Vol_dn
type: parsed
protocol: NECext
address: 00 BF 00 00
command: 43 BC 00 00
#
name: Ch_next
type: parsed
protocol: NECext
address: 00 BF 00 00
command: 4A B5 00 00
#
name: Ch_prev
type: parsed
protocol: NECext
address: 00 BF 00 00
command: 4B B4 00 00
#
# Model: Viano STV65UHD4K
#
name: Power
type: parsed
protocol: NECext
address: 00 7F 00 00
command: 1E E1 00 00
#
name: Vol_up
type: parsed
protocol: NECext
address: 00 7F 00 00
command: 0A F5 00 00
#
name: Vol_dn
type: parsed
protocol: NECext
address: 00 7F 00 00
command: 06 F9 00 00
#
name: Ch_next
type: parsed
protocol: NECext
address: 00 7F 00 00
command: 5B A4 00 00
#
name: Ch_prev
type: parsed
protocol: NECext
address: 00 7F 00 00
command: 18 E7 00 00

View file

@ -32,6 +32,16 @@ class FlipperFormatFile:
raise Exception("Unexpected line: not `key:value`")
return data[0].strip(), data[1].strip()
def readComment(self):
if self.cursor == len(self.lines):
raise EOFError()
line = self.lines[self.cursor].strip()
if line.startswith("#"):
self.cursor += 1
return line[1:].strip()
else:
return None
def readKey(self, key: str):
k, v = self.readKeyValue()
if k != key:
@ -67,7 +77,7 @@ class FlipperFormatFile:
self.writeLine("")
def writeComment(self, text: str):
if text:
if text and len(text):
self.writeLine(f"# {text}")
else:
self.writeLine("#")
@ -104,3 +114,4 @@ class FlipperFormatFile:
def save(self, filename: str):
with open(filename, "w", newline="\n") as file:
file.write("\n".join(self.lines))
file.write("\n")

View file

@ -27,37 +27,51 @@ class Main(App):
return 1
data = []
unique = {}
unique_combo = {}
unique_payload = {}
while True:
try:
d = {}
d["comments"] = []
while (comment := f.readComment()) is not None:
d["comments"].append(comment)
d["name"] = f.readKey("name")
d["type"] = f.readKey("type")
key = None
key_combo = f'{d["name"]}'
key_payload = None
if d["type"] == "parsed":
d["protocol"] = f.readKey("protocol")
d["address"] = f.readKey("address")
d["command"] = f.readKey("command")
key = f'{d["protocol"]}{d["address"]}{d["command"]}'
key_payload = f'{d["protocol"]}{d["address"]}{d["command"]}'
key_combo += key_payload
elif d["type"] == "raw":
d["frequency"] = f.readKey("frequency")
d["duty_cycle"] = f.readKey("duty_cycle")
d["data"] = f.readKey("data")
key = f'{d["frequency"]}{d["duty_cycle"]}{d["data"]}'
key_payload = f'{d["frequency"]}{d["duty_cycle"]}{d["data"]}'
key_combo += key_payload
else:
raise Exception(f'Unknown type: {d["type"]}')
if not key in unique:
unique[key] = d
if not key_combo in unique_combo:
unique_combo[key_combo] = d
data.append(d)
# Check payload only
if not key_payload in unique_payload:
unique_payload[key_payload] = d
else:
self.logger.warn(f"Duplicate key: {key}")
self.logger.warning(f"Duplicate payload, check manually: {d}")
else:
self.logger.info(f"Duplicate data removed: {d}")
except EOFError:
break
# Form new file
f = FlipperFormatFile()
f.setHeader(filetype, version)
for i in data:
f.writeComment(None)
for comment in i["comments"]:
f.writeComment(comment)
f.writeKey("name", i["name"])
f.writeKey("type", i["type"])
if i["type"] == "parsed":

View file

@ -121,7 +121,7 @@ class Main(App):
try:
shutil.rmtree(self.output_dir_path)
except Exception as ex:
self.logger.warn(f"Failed to clean output directory: {ex}")
self.logger.warning(f"Failed to clean output directory: {ex}")
if not exists(self.output_dir_path):
self.logger.debug(f"Creating output directory {self.output_dir_path}")

View file

@ -152,7 +152,7 @@ class Main(App):
return 3
if not self.layout_check(updater_stage_size, dfu_size, radio_addr):
self.logger.warn("Memory layout looks suspicious")
self.logger.warning("Memory layout looks suspicious")
if self.args.disclaimer != "yes":
self.show_disclaimer()
return 2
@ -205,7 +205,7 @@ class Main(App):
def layout_check(self, stage_size, fw_size, radio_addr):
if stage_size > self.UPDATER_SIZE_THRESHOLD:
self.logger.warn(
self.logger.warning(
f"Updater size {stage_size}b > {self.UPDATER_SIZE_THRESHOLD}b and is not loadable on older firmwares!"
)
@ -217,13 +217,13 @@ class Main(App):
self.logger.debug(f"Expected reserved space size: {fw2stack_gap}")
fw2stack_gap_pages = fw2stack_gap / self.FLASH_PAGE_SIZE
if fw2stack_gap_pages < 0:
self.logger.warn(
self.logger.warning(
f"Firmware image overlaps C2 region and is not programmable!"
)
return False
elif fw2stack_gap_pages < self.MIN_GAP_PAGES:
self.logger.warn(
self.logger.warning(
f"Expected reserved flash size is too small (~{int(fw2stack_gap_pages)} page(s), need >={self.MIN_GAP_PAGES} page(s))"
)
return False