Skip to content

Commit

Permalink
check for service mode when querying child bridge status
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Nov 16, 2024
1 parent 722915e commit 0f5993e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file.
### Other Changes

- migrate `@zajsf/*` to `@ng-formworks/*` for plugin schema forms
- check for service mode when querying child bridge status

### Homebridge Dependencies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export class CustomPluginsComponent implements OnInit, OnDestroy {
return
}

if (!['homebridge', 'homebridge-config-ui-x'].includes(this.plugin.name)) {
if (!['homebridge', 'homebridge-config-ui-x'].includes(this.plugin.name) && this.$settings.env.serviceMode) {
await this.getChildBridges()
if (this.childBridges.length > 0) {
this.$activeModal.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ export class ManagePluginComponent implements OnInit, OnDestroy {
}

async getChildBridges(): Promise<void> {
if (!this.$settings.env.serviceMode) {
return
}
const data: any[] = await firstValueFrom(this.$api.get('/status/homebridge/child-bridges'))
data.forEach((bridge) => {
if (this.pluginName === bridge.plugin) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class ManualConfigComponent implements OnInit {
return
}

if (!['homebridge', 'homebridge-config-ui-x'].includes(this.plugin.name)) {
if (!['homebridge', 'homebridge-config-ui-x'].includes(this.plugin.name) && this.$settings.env.serviceMode) {
await this.getChildBridges()
if (this.childBridges.length > 0) {
this.$activeModal.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class PluginConfigComponent implements OnInit {
}
}

if (!['homebridge', 'homebridge-config-ui-x'].includes(this.plugin.name)) {
if (!['homebridge', 'homebridge-config-ui-x'].includes(this.plugin.name) && this.$settings.env.serviceMode) {
await this.getChildBridges()
if (this.childBridges.length > 0) {
this.$activeModal.close()
Expand Down

0 comments on commit 0f5993e

Please sign in to comment.