Skip to content

Commit 52a771e

Browse files
committed
Add Debug card in configuration
Fixed slave: stateTopic Button (clipboard)
1 parent 3605228 commit 52a771e

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

src/app/configure/configure.component.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@
6666
</form>
6767

6868
</mat-card>
69+
<div class="flexcols">
6970

70-
<mat-card class="width250pt card">
71+
<mat-card class="width350pt card">
7172
<mat-card-header>
7273
<mat-card-title>Configure Github</mat-card-title>
7374
</mat-card-header>
@@ -79,5 +80,18 @@
7980

8081
</mat-card-content>
8182
</mat-card>
83+
<mat-card class="width350pt card">
84+
<mat-card-header>
85+
<mat-card-title>Configure Debug</mat-card-title>
86+
</mat-card-header>
87+
<mat-card-content>
88+
<mat-form-field class="width250pt">
89+
<mat-label>Debug components</mat-label>
90+
<input matInput [formControl]="debugComponentsFormControl" />
91+
</mat-form-field>
92+
93+
</mat-card-content>
94+
</mat-card>
95+
</div>
8296
</div>
8397
</div>

src/app/configure/configure.component.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class ConfigureComponent implements OnInit {
7070
private router: Router,
7171
) {
7272
this.ghPersonalAccessToken = _formBuilder.control([""]);
73+
this.debugComponentsFormControl = _formBuilder.control([""]);
7374
}
7475
private requiredInNonAddonScenario: ValidatorFn = (
7576
control: AbstractControl,
@@ -89,6 +90,7 @@ export class ConfigureComponent implements OnInit {
8990
!this.authStatus.hassiotoken) ||
9091
(this.configureMqttFormGroup.pristine &&
9192
this.ghPersonalAccessToken.pristine &&
93+
this.debugComponentsFormControl.pristine &&
9294
this.discoveryLanguageFormControl.pristine)
9395
);
9496
}
@@ -107,6 +109,7 @@ export class ConfigureComponent implements OnInit {
107109
mqttcafile: [null as string | null],
108110
});
109111
ghPersonalAccessToken: FormControl;
112+
debugComponentsFormControl: FormControl;
110113
discoveryLanguageFormControl = new FormControl<string | null>(null);
111114
connectMessage: string = "";
112115
ngOnInit(): void {
@@ -132,6 +135,12 @@ export class ConfigureComponent implements OnInit {
132135
config.mqttdiscoverylanguage,
133136
);
134137
}
138+
if (config.debugComponents) {
139+
this.debugComponentsFormControl!.setValue(
140+
config.debugComponents
141+
);
142+
}
143+
135144
this.entityApiService.getSslFiles().subscribe((rc) => {
136145
this.sslFiles = rc;
137146
});
@@ -196,7 +205,12 @@ export class ConfigureComponent implements OnInit {
196205
this.ghPersonalAccessToken &&
197206
this.ghPersonalAccessToken.value.length > 0
198207
)
199-
this.config.githubPersonalToken = this.ghPersonalAccessToken.value;
208+
this.config.githubPersonalToken = this.ghPersonalAccessToken.value;
209+
if (
210+
this.debugComponentsFormControl &&
211+
this.debugComponentsFormControl.value.length > 0
212+
)
213+
this.config.debugComponents = this.debugComponentsFormControl.value;
200214
this.entityApiService.postConfiguration(this.config).subscribe(() => {
201215
this.close();
202216
});

src/app/select-slave/select-slave.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h2>State Topic</h2>
134134

135135
<div>
136136
{{ getStateTopic(uislave) }}<button mat-icon-button mat-small-icon-button class="material-icons app-toolbar-menu save-button"
137-
matTooltip="Copy to Clipboard" (click)="copy2Clipboard(uislave.stateTopic!)" color="primary">
137+
matTooltip="Copy to Clipboard" (click)="copy2Clipboard(getStateTopic(uislave) )" color="primary">
138138
<mat-icon>content_copy</mat-icon>
139139
</button>
140140
</div>

0 commit comments

Comments
 (0)