@@ -778,10 +778,9 @@ pub struct MatrixLedConfig {
778
778
779
779
impl Default for MatrixLedConfig {
780
780
fn default ( ) -> Self {
781
- // TODO: Check those default values?
782
781
Self {
783
- ledshoriz : 0 ,
784
- ledsvert : 0 ,
782
+ ledshoriz : 1 ,
783
+ ledsvert : 1 ,
785
784
cabling : MatrixCabling :: Snake ,
786
785
start : MatrixStart :: TopLeft ,
787
786
}
@@ -1396,9 +1395,8 @@ pub enum ConfigError {
1396
1395
Meta ( #[ from] MetaError ) ,
1397
1396
#[ error( "error loading user: {0}" ) ]
1398
1397
User ( #[ from] UserError ) ,
1399
- // TODO: Say which setting?
1400
- #[ error( "missing hyperion_inst field on instance setting" ) ]
1401
- MissingHyperionInst ,
1398
+ #[ error( "missing hyperion_inst field on instance setting {0}" ) ]
1399
+ MissingHyperionInst ( & ' static str ) ,
1402
1400
#[ error( "invalid JSON: {0}" ) ]
1403
1401
Json ( #[ from] serde_json:: Error ) ,
1404
1402
}
@@ -1439,7 +1437,7 @@ impl Config {
1439
1437
. get_mut (
1440
1438
& setting
1441
1439
. hyperion_inst
1442
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1440
+ . ok_or ( ConfigError :: MissingHyperionInst ( "backgroundEffect" ) ) ?,
1443
1441
)
1444
1442
. unwrap ( )
1445
1443
. background_effect = Some ( config)
@@ -1449,7 +1447,7 @@ impl Config {
1449
1447
. get_mut (
1450
1448
& setting
1451
1449
. hyperion_inst
1452
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1450
+ . ok_or ( ConfigError :: MissingHyperionInst ( "blackborderdetector" ) ) ?,
1453
1451
)
1454
1452
. unwrap ( )
1455
1453
. black_border_detector = Some ( config)
@@ -1459,7 +1457,7 @@ impl Config {
1459
1457
. get_mut (
1460
1458
& setting
1461
1459
. hyperion_inst
1462
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1460
+ . ok_or ( ConfigError :: MissingHyperionInst ( "boblightServer" ) ) ?,
1463
1461
)
1464
1462
. unwrap ( )
1465
1463
. boblight_server = Some ( config)
@@ -1469,7 +1467,7 @@ impl Config {
1469
1467
. get_mut (
1470
1468
& setting
1471
1469
. hyperion_inst
1472
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1470
+ . ok_or ( ConfigError :: MissingHyperionInst ( "color" ) ) ?,
1473
1471
)
1474
1472
. unwrap ( )
1475
1473
. color = Some ( config)
@@ -1479,7 +1477,7 @@ impl Config {
1479
1477
. get_mut (
1480
1478
& setting
1481
1479
. hyperion_inst
1482
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1480
+ . ok_or ( ConfigError :: MissingHyperionInst ( "device" ) ) ?,
1483
1481
)
1484
1482
. unwrap ( )
1485
1483
. device = Some ( config)
@@ -1489,7 +1487,7 @@ impl Config {
1489
1487
. get_mut (
1490
1488
& setting
1491
1489
. hyperion_inst
1492
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1490
+ . ok_or ( ConfigError :: MissingHyperionInst ( "effects" ) ) ?,
1493
1491
)
1494
1492
. unwrap ( )
1495
1493
. effects = Some ( config)
@@ -1499,7 +1497,7 @@ impl Config {
1499
1497
. get_mut (
1500
1498
& setting
1501
1499
. hyperion_inst
1502
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1500
+ . ok_or ( ConfigError :: MissingHyperionInst ( "foregroundEffect" ) ) ?,
1503
1501
)
1504
1502
. unwrap ( )
1505
1503
. foreground_effect = Some ( config)
@@ -1509,7 +1507,7 @@ impl Config {
1509
1507
. get_mut (
1510
1508
& setting
1511
1509
. hyperion_inst
1512
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1510
+ . ok_or ( ConfigError :: MissingHyperionInst ( "instCapture" ) ) ?,
1513
1511
)
1514
1512
. unwrap ( )
1515
1513
. instance_capture = Some ( config)
@@ -1519,7 +1517,7 @@ impl Config {
1519
1517
. get_mut (
1520
1518
& setting
1521
1519
. hyperion_inst
1522
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1520
+ . ok_or ( ConfigError :: MissingHyperionInst ( "ledConfig" ) ) ?,
1523
1521
)
1524
1522
. unwrap ( )
1525
1523
. led_config = Some ( config)
@@ -1529,7 +1527,7 @@ impl Config {
1529
1527
. get_mut (
1530
1528
& setting
1531
1529
. hyperion_inst
1532
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1530
+ . ok_or ( ConfigError :: MissingHyperionInst ( "leds" ) ) ?,
1533
1531
)
1534
1532
. unwrap ( )
1535
1533
. leds = Some ( config)
@@ -1539,7 +1537,7 @@ impl Config {
1539
1537
. get_mut (
1540
1538
& setting
1541
1539
. hyperion_inst
1542
- . ok_or ( ConfigError :: MissingHyperionInst ) ?,
1540
+ . ok_or ( ConfigError :: MissingHyperionInst ( "smoothing" ) ) ?,
1543
1541
)
1544
1542
. unwrap ( )
1545
1543
. smoothing = Some ( config)
0 commit comments