diff --git a/app.json b/app.json index 4adf414..50f4b79 100644 --- a/app.json +++ b/app.json @@ -2324,18 +2324,6 @@ "en": "CAUTION: Some settings are not supported by every device." }, "children": [ - { - "id": "percent_control", - "type": "number", - "label": { - "en": "Motor torque" - }, - "value": 0, - "min": 0, - "max": 100, - "step": 1, - "units": "%" - }, { "id": "inverse", "type": "checkbox", diff --git a/drivers/curtain/TuyaCurtainConstants.ts b/drivers/curtain/TuyaCurtainConstants.ts index f3818c4..568e73e 100644 --- a/drivers/curtain/TuyaCurtainConstants.ts +++ b/drivers/curtain/TuyaCurtainConstants.ts @@ -12,18 +12,15 @@ export const CURTAIN_CAPABILITIES = { export type HomeyCurtainSettings = { inverse: boolean; - percent_control: number; }; export type TuyaCurtainSettings = { - percent_control: number; opposite: boolean; // inverse control_back: boolean; // inverse control_back_mode: 'forward' | 'back'; // inverse }; export const CURTAIN_SETTING_LABELS = { - percent_control: 'Motor torque', opposite: 'Inverse direction', control_back: 'Inverse direction', control_back_mode: 'Inverse direction', diff --git a/drivers/curtain/device.ts b/drivers/curtain/device.ts index c324aa2..42f28c4 100644 --- a/drivers/curtain/device.ts +++ b/drivers/curtain/device.ts @@ -1,5 +1,5 @@ import TuyaOAuth2Device from '../../lib/TuyaOAuth2Device'; -import { filterTuyaSettings, getFromMap } from '../../lib/TuyaOAuth2Util'; +import { getFromMap } from '../../lib/TuyaOAuth2Util'; import * as TuyaOAuth2Util from '../../lib/TuyaOAuth2Util'; import { SettingsEvent, TuyaStatus } from '../../types/TuyaTypes'; import { @@ -67,10 +67,6 @@ module.exports = class TuyaOAuth2DeviceCurtain extends TuyaOAuth2Device { await this.safeSetCapabilityValue(homeyCapability, (value as number) / 100); } - if (tuyaCapability === 'percent_control') { - await this.setSettings({ [tuyaCapability]: value }).catch(this.error); - } - if (['opposite', 'control_back'].includes(tuyaCapability)) { await this.setSettings({ inverse: value }).catch(this.error); } @@ -82,9 +78,11 @@ module.exports = class TuyaOAuth2DeviceCurtain extends TuyaOAuth2Device { } async onSettings(event: SettingsEvent): Promise { - const tuyaSettings = filterTuyaSettings(event, [ - 'percent_control', - ]) as unknown as SettingsEvent; + const tuyaSettings: SettingsEvent> = { + newSettings: {}, + oldSettings: {}, + changedKeys: [], + }; if (event.changedKeys.includes('inverse')) { if (this.hasTuyaCapability('control_back')) { diff --git a/drivers/curtain/driver.settings.compose.json b/drivers/curtain/driver.settings.compose.json index a26592d..904a8f5 100644 --- a/drivers/curtain/driver.settings.compose.json +++ b/drivers/curtain/driver.settings.compose.json @@ -5,18 +5,6 @@ "en": "CAUTION: Some settings are not supported by every device." }, "children": [ - { - "id": "percent_control", - "type": "number", - "label": { - "en": "Motor torque" - }, - "value": 0, - "min": 0, - "max": 100, - "step": 1, - "units": "%" - }, { "id": "inverse", "type": "checkbox",