Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Dec 5, 2024
1 parent b53162b commit 086cd5b
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 31 deletions.
6 changes: 3 additions & 3 deletions docs/assets/main.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions docs/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,20 @@
cursor: pointer;
}

.tsd-full-hierarchy:not(:last-child) {
margin-bottom: 1em;
padding-bottom: 1em;
border-bottom: 1px solid var(--color-accent);
}
.tsd-full-hierarchy,
.tsd-full-hierarchy ul {
list-style: none;
margin: 0;
padding: 0;
}
.tsd-full-hierarchy ul {
padding-left: 1.5rem;
}
.tsd-full-hierarchy a {
padding: 0.25rem 0 !important;
font-size: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion docs/functions/default.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>default | @switchbot/homebridge-switchbot</title><meta name="description" content="Documentation for @switchbot/homebridge-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@switchbot/homebridge-switchbot</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@switchbot/homebridge-switchbot</a></li><li><a href="default.html">default</a></li></ul><h1>Function default</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="default" class="tsd-anchor"></a><span class="tsd-kind-call-signature">default</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">API</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">api</span>: <span class="tsd-signature-type">API</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/homebridge-switchbot/blob/0edc67107e66a52e7b8906167ee33c6584579895/src/index.ts#L11">index.ts:11</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@switchbot/homebridge-switchbot</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>default | @switchbot/homebridge-switchbot</title><meta name="description" content="Documentation for @switchbot/homebridge-switchbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@switchbot/homebridge-switchbot</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@switchbot/homebridge-switchbot</a></li><li><a href="default.html">default</a></li></ul><h1>Function default</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="default" class="tsd-anchor"></a><span class="tsd-kind-call-signature">default</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">api</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">API</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">api</span>: <span class="tsd-signature-type">API</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/OpenWonderLabs/homebridge-switchbot/blob/b53162b43fc814b31526716b740ea7721fa041eb/src/index.ts#L11">index.ts:11</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@switchbot/homebridge-switchbot</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"async-mqtt": "^2.6.3",
"fakegato-history": "^0.6.5",
"homebridge-lib": "^7.1.0",
"node-switchbot": "^3.5.0-beta.0",
"node-switchbot": "^3.4.2-beta.3",
"rxjs": "^7.8.1"
},
"devDependencies": {
Expand All @@ -100,7 +100,7 @@
"nodemon": "^3.1.7",
"shx": "^0.3.4",
"ts-node": "^10.9.2",
"typedoc": "^0.27.2",
"typedoc": "^0.27.3",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
},
Expand Down
5 changes: 2 additions & 3 deletions src/device/fan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,13 @@ export class Fan extends deviceBase {
switchBotBLE
.discover({ model: this.device.bleModel, id: this.device.bleMac })
.then(async (device_list: SwitchbotDevice[]) => {
const deviceList = device_list as SwitchbotDevice[]
return await this.retryBLE({
max: this.maxRetryBLE(),
fn: async () => {
if (this.Fan.Active) {
return await deviceList[0].turnOn()
return await (device_list[0] as any).turnOn()
} else {
return await deviceList[0].turnOff()
return await (device_list[0] as any).turnOff()
}
},
})
Expand Down
3 changes: 1 addition & 2 deletions src/device/humidifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ export class Humidifier extends deviceBase {
switchBotBLE
.discover({ model: this.device.bleModel, quick: true, id: this.device.bleMac })
.then(async (device_list: SwitchbotDevice[]) => {
const deviceList = device_list as WoHumi[]
return await deviceList[0].percentage(this.HumidifierDehumidifier.RelativeHumidityHumidifierThreshold)
return await (device_list[0] as WoHumi).percentage(Number(this.HumidifierDehumidifier.RelativeHumidityHumidifierThreshold))
})
.then(async () => {
this.successLog(`RelativeHumidityHumidifierThreshold: ${this.HumidifierDehumidifier.RelativeHumidityHumidifierThreshold} sent over BLE, sent successfully`)
Expand Down
4 changes: 2 additions & 2 deletions src/device/lightstrip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ export class StripLight extends deviceBase {
.discover({ model: this.device.bleModel, id: this.device.bleMac })
.then(async (device_list: SwitchbotDevice[]) => {
this.infoLog(`Brightness: ${this.LightBulb.Brightness}`)
return await device_list[0].setBrightness(this.LightBulb.Brightness)
return await (device_list[0] as WoStrip).setBrightness(Number(this.LightBulb.Brightness))
})
.then(async () => {
this.successLog(`Brightness: ${this.LightBulb.Brightness} sent over SwitchBot BLE, sent successfully`)
Expand Down Expand Up @@ -551,7 +551,7 @@ export class StripLight extends deviceBase {
.discover({ model: this.device.bleModel, id: this.device.bleMac })
.then(async (device_list: SwitchbotDevice[]) => {
this.infoLog(`RGB: ${(this.LightBulb.Brightness, red, green, blue)}`)
return await device_list[0].setRGB(this.LightBulb.Brightness, red, green, blue)
return await (device_list[0] as WoStrip).setRGB(Number(this.LightBulb.Brightness), red, green, blue)
})
.then(async () => {
this.successLog(`RGB: ${(this.LightBulb.Brightness, red, green, blue)} sent over SwitchBot BLE, sent successfully`)
Expand Down
6 changes: 3 additions & 3 deletions src/device/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* lock.ts: @switchbot/homebridge-switchbot.
*/
import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'
import type { bodyChange, device, lockProServiceData, lockProStatus, lockProWebhookContext, lockServiceData, lockStatus, lockWebhookContext, SwitchbotDevice } from 'node-switchbot'
import type { bodyChange, device, lockProServiceData, lockProStatus, lockProWebhookContext, lockServiceData, lockStatus, lockWebhookContext, SwitchbotDevice, WoSmartLock } from 'node-switchbot'

import type { SwitchBotPlatform } from '../platform.js'
import type { devicesConfig, lockConfig } from '../settings.js'
Expand Down Expand Up @@ -451,9 +451,9 @@ export class Lock extends deviceBase {
max: this.maxRetryBLE(),
fn: async () => {
if (this.LockMechanism.LockTargetState === this.hap.Characteristic.LockTargetState.SECURED) {
return await device_list[0].lock({ id: this.device.bleMac })
return await (device_list[0] as WoSmartLock).lock()
} else {
return await device_list[0].unlock({ id: this.device.bleMac })
return await (device_list[0] as WoSmartLock).unlock()
}
},
})
Expand Down
5 changes: 2 additions & 3 deletions src/device/robotvacuumcleaner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,14 @@ export class RobotVacuumCleaner extends deviceBase {
switchBotBLE
.discover({ model: this.device.bleModel, id: this.device.bleMac })
.then(async (device_list: SwitchbotDevice[]) => {
const deviceList = device_list as SwitchbotDevice[]
this.infoLog(`On: ${this.LightBulb.On}`)
return await this.retryBLE({
max: this.maxRetryBLE(),
fn: async () => {
if (this.LightBulb.On) {
return await deviceList[0].turnOn()
return await (device_list[0] as any).turnOn()
} else {
return await deviceList[0].turnOff()
return await (device_list[0] as any).turnOff()
}
},
})
Expand Down

0 comments on commit 086cd5b

Please sign in to comment.