@@ -886,7 +886,7 @@ export class ADTPulsePlatform implements ADTPulsePlatformPlugin {
886
886
* @since 1.0.0
887
887
*/
888
888
private async logStatusChanges ( oldCache : ADTPulsePlatformLogStatusChangesOldCache , newCache : ADTPulsePlatformLogStatusChangesNewCache ) : ADTPulsePlatformLogStatusChangesReturns {
889
- // Fetch gateway device status .
889
+ // Fetch gateway information .
890
890
if ( oldCache . gatewayInfo !== null && newCache . gatewayInfo !== null ) {
891
891
const oldStatus = oldCache . gatewayInfo . status ;
892
892
const newStatus = newCache . gatewayInfo . status ;
@@ -896,7 +896,7 @@ export class ADTPulsePlatform implements ADTPulsePlatformPlugin {
896
896
}
897
897
}
898
898
899
- // Fetch the panel device status .
899
+ // Fetch the panel information .
900
900
if ( oldCache . panelInfo !== null && newCache . panelInfo !== null ) {
901
901
const oldStatus = oldCache . panelInfo . status ;
902
902
const newStatus = newCache . panelInfo . status ;
@@ -906,7 +906,19 @@ export class ADTPulsePlatform implements ADTPulsePlatformPlugin {
906
906
}
907
907
}
908
908
909
- // Fetch the sensors device status.
909
+ // Fetch the panel status.
910
+ if ( oldCache . panelStatus !== null && newCache . panelStatus !== null ) {
911
+ const oldStatus = oldCache . panelStatus . rawData . node ;
912
+ const newStatus = newCache . panelStatus . rawData . node ;
913
+ const splitOldStatus = oldStatus . split ( textOrbTextSummarySections ) . filter ( Boolean ) . join ( ' / ' ) ;
914
+ const splitNewStatus = newStatus . split ( textOrbTextSummarySections ) . filter ( Boolean ) . join ( ' / ' ) ;
915
+
916
+ if ( oldStatus !== newStatus ) {
917
+ this . #log. info ( `${ chalk . underline ( 'Security Panel' ) } state changed (old: "${ splitOldStatus } ", new: "${ splitNewStatus } ").` ) ;
918
+ }
919
+ }
920
+
921
+ // Fetch the sensors information.
910
922
if (
911
923
this . #config !== null
912
924
&& this . #config. sensors . length > 0 // Only show status changed if user configured sensors.
@@ -925,27 +937,15 @@ export class ADTPulsePlatform implements ADTPulsePlatformPlugin {
925
937
}
926
938
}
927
939
} else {
928
- this . #log. warn ( 'Changes to sensors device status cannot be determined due to length inconsistencies.' ) ;
940
+ this . #log. warn ( 'Changes to sensors information cannot be determined due to length inconsistencies.' ) ;
929
941
stackTracer ( 'log-status-changes' , {
930
942
old : oldCache . sensorsInfo ,
931
943
new : newCache . sensorsInfo ,
932
944
} ) ;
933
945
}
934
946
}
935
947
936
- // Fetch the panel device state.
937
- if ( oldCache . panelStatus !== null && newCache . panelStatus !== null ) {
938
- const oldStatus = oldCache . panelStatus . rawData . node ;
939
- const newStatus = newCache . panelStatus . rawData . node ;
940
- const splitOldStatus = oldStatus . split ( textOrbTextSummarySections ) . filter ( Boolean ) . join ( ' / ' ) ;
941
- const splitNewStatus = newStatus . split ( textOrbTextSummarySections ) . filter ( Boolean ) . join ( ' / ' ) ;
942
-
943
- if ( oldStatus !== newStatus ) {
944
- this . #log. info ( `${ chalk . underline ( 'Security Panel' ) } state changed (old: "${ splitOldStatus } ", new: "${ splitNewStatus } ").` ) ;
945
- }
946
- }
947
-
948
- // Fetch the sensors device state.
948
+ // Fetch the sensors status.
949
949
if (
950
950
this . #config !== null
951
951
&& this . #config. sensors . length > 0 // Only show status changed if user configured sensors.
@@ -964,7 +964,7 @@ export class ADTPulsePlatform implements ADTPulsePlatformPlugin {
964
964
}
965
965
}
966
966
} else {
967
- this . #log. warn ( 'Changes to sensors device state cannot be determined due to length inconsistencies.' ) ;
967
+ this . #log. warn ( 'Changes to sensors status cannot be determined due to length inconsistencies.' ) ;
968
968
stackTracer ( 'log-status-changes' , {
969
969
old : oldCache . sensorsStatus ,
970
970
new : newCache . sensorsStatus ,
@@ -1044,11 +1044,12 @@ export class ADTPulsePlatform implements ADTPulsePlatformPlugin {
1044
1044
// Add gateway as an accessory.
1045
1045
if ( gatewayInfo !== null ) {
1046
1046
const id = 'adt-device-0' ;
1047
+ const name = gatewayInfo . manufacturer ?? gatewayInfo . model ?? 'ADT Pulse Gateway' ;
1047
1048
1048
1049
devices . push ( {
1049
1050
id,
1050
- name : 'ADT Pulse Gateway' ,
1051
- originalName : 'ADT Pulse Gateway' ,
1051
+ name : ( name . includes ( 'Gateway' ) ) ? name : 'ADT Pulse Gateway' ,
1052
+ originalName : ( name . includes ( 'Gateway' ) ) ? name : 'ADT Pulse Gateway' ,
1052
1053
type : 'gateway' ,
1053
1054
zone : null ,
1054
1055
category : 'OTHER' ,
0 commit comments