Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Dec 10, 2024
1 parent e83f40a commit c4b8fa2
Show file tree
Hide file tree
Showing 10 changed files with 549 additions and 639 deletions.
3 changes: 1 addition & 2 deletions lib/device/garage-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ export default class {
hardware: this.accessory.context.hardware,
ipAddress: this.accessory.context.ipAddress,
firmware: this.accessory.context.firmware,
isOnline: this.accessory.context.isOnline
,
isOnline: this.accessory.context.isOnline,
}
this.platform.updateAccessory(subAcc)
}
Expand Down
2 changes: 1 addition & 1 deletion lib/device/garage-single.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export default class {
await this.platform.sendUpdate(this.accessory, {
namespace,
payload,
})
}, { insecureHTTPParser: true })
}

// Update the cache target state if different
Expand Down
4 changes: 2 additions & 2 deletions lib/device/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import deviceLightRGB from './light-rgb.js'
import deviceOutletMulti from './outlet-multi.js'
import deviceOutletSingle from './outlet-single.js'
import devicePowerStrip from './power-strip.js'
import devicePurifier from './purifier.js'
import devicePurifierSingle from './purifier-single.js'
import deviceRoller from './roller.js'
import devicePurifier from './purifier.js'
import deviceRollerLocation from './roller-location.js'
import deviceRoller from './roller.js'
import deviceSensorPresence from './sensor-presence.js'
import deviceSwitchMulti from './switch-multi.js'
import deviceSwitchSingle from './switch-single.js'
Expand Down
11 changes: 5 additions & 6 deletions lib/device/outlet-multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ export default class {
hardware: this.accessory.context.hardware,
ipAddress: this.accessory.context.ipAddress,
firmware: this.accessory.context.firmware,
isOnline: this.accessory.context.isOnline
,
isOnline: this.accessory.context.isOnline,
}
this.platform.updateAccessory(subAcc)
}
Expand Down Expand Up @@ -336,10 +335,10 @@ export default class {
const accessory = channel.channel === 0
? this.accessory
: this.devicesInHB.get(
this.platform.api.hap.uuid.generate(
this.accessory.context.serialNumber + channel.channel,
),
)
this.platform.api.hap.uuid.generate(
this.accessory.context.serialNumber + channel.channel,
),
)

// Check the accessory exists
if (!accessory) {
Expand Down
3 changes: 1 addition & 2 deletions lib/device/power-strip.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ export default class {
hardware: this.accessory.context.hardware,
ipAddress: this.accessory.context.ipAddress,
firmware: this.accessory.context.firmware,
isOnline: this.accessory.context.isOnline
,
isOnline: this.accessory.context.isOnline,
}
this.platform.updateAccessory(this.accessory)
}
Expand Down
11 changes: 5 additions & 6 deletions lib/device/switch-multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ export default class {
hardware: this.accessory.context.hardware,
ipAddress: this.accessory.context.ipAddress,
firmware: this.accessory.context.firmware,
isOnline: this.accessory.context.isOnline
,
isOnline: this.accessory.context.isOnline,
}
this.platform.updateAccessory(subAcc)
}
Expand Down Expand Up @@ -348,10 +347,10 @@ export default class {
const accessory = channel.channel === 0
? this.accessory
: this.devicesInHB.get(
this.platform.api.hap.uuid.generate(
this.accessory.context.serialNumber + channel.channel,
),
)
this.platform.api.hap.uuid.generate(
this.accessory.context.serialNumber + channel.channel,
),
)

// Check the accessory exists
if (!accessory) {
Expand Down
4 changes: 4 additions & 0 deletions lib/homebridge-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ <h4>Disclaimer</h4>
const introContinue = document.getElementById('introContinue')
introContinue.addEventListener('click', () => {
homebridge.showSpinner()
homebridge.disableSaveButton?.()
document.getElementById('pageIntro').style.display = 'none'
document.getElementById('menuWrapper').style.display = 'inline-flex'
showSettings()
Expand All @@ -208,6 +209,7 @@ <h4>Disclaimer</h4>
}
showDevices = async () => {
homebridge.showSpinner()
homebridge.disableSaveButton?.()
homebridge.hideSchemaForm()
document.getElementById('menuHome').classList.remove('btn-elegant')
document.getElementById('menuHome').classList.add('btn-primary')
Expand Down Expand Up @@ -272,6 +274,7 @@ <h4>Disclaimer</h4>
}
showSupport = () => {
homebridge.showSpinner()
homebridge.disableSaveButton?.()
homebridge.hideSchemaForm()
document.getElementById('menuHome').classList.add('btn-elegant')
document.getElementById('menuHome').classList.remove('btn-primary')
Expand All @@ -285,6 +288,7 @@ <h4>Disclaimer</h4>
}
showSettings = () => {
homebridge.showSpinner()
homebridge.enableSaveButton?.()
document.getElementById('menuHome').classList.remove('btn-elegant')
document.getElementById('menuHome').classList.add('btn-primary')
document.getElementById('menuDevices').classList.remove('btn-elegant')
Expand Down
3 changes: 2 additions & 1 deletion lib/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ export default class {
}
}

async sendUpdate(accessory, toSend) {
async sendUpdate(accessory, toSend, opts = {}) {
// Variable res is the response from either the cloud mqtt update or local http request
let res

Expand Down Expand Up @@ -1203,6 +1203,7 @@ export default class {
data,
responseType: 'json',
timeout: toSend.method === 'GET' || accessory.context.connection === 'local' ? 9000 : 4000,
insecureHTTPParser: !!opts.insecureHTTPParser,
})

// Check the response properties based on whether it is a control or request update
Expand Down
Loading

0 comments on commit c4b8fa2

Please sign in to comment.