Merge pull request #8652 from effelle/development

Prep for Tuya MCU HAss Discovery
This commit is contained in:
Theo Arends 2020-06-09 19:43:23 +02:00 committed by GitHub
commit bf4aed6969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 31 deletions

View File

@ -344,4 +344,12 @@ const SerConfu8 kTasmotaSerialConfig[] PROGMEM = {
SERIAL_5O2, SERIAL_6O2, SERIAL_7O2, SERIAL_8O2
};
enum TuyaSupportedFunctions { TUYA_MCU_FUNC_NONE, TUYA_MCU_FUNC_SWT1 = 1, TUYA_MCU_FUNC_SWT2, TUYA_MCU_FUNC_SWT3, TUYA_MCU_FUNC_SWT4,
TUYA_MCU_FUNC_REL1 = 11, TUYA_MCU_FUNC_REL2, TUYA_MCU_FUNC_REL3, TUYA_MCU_FUNC_REL4, TUYA_MCU_FUNC_REL5,
TUYA_MCU_FUNC_REL6, TUYA_MCU_FUNC_REL7, TUYA_MCU_FUNC_REL8, TUYA_MCU_FUNC_DIMMER = 21, TUYA_MCU_FUNC_POWER = 31,
TUYA_MCU_FUNC_CURRENT, TUYA_MCU_FUNC_VOLTAGE, TUYA_MCU_FUNC_BATTERY_STATE, TUYA_MCU_FUNC_BATTERY_PERCENTAGE,
TUYA_MCU_FUNC_REL1_INV = 41, TUYA_MCU_FUNC_REL2_INV, TUYA_MCU_FUNC_REL3_INV, TUYA_MCU_FUNC_REL4_INV, TUYA_MCU_FUNC_REL5_INV,
TUYA_MCU_FUNC_REL6_INV, TUYA_MCU_FUNC_REL7_INV, TUYA_MCU_FUNC_REL8_INV, TUYA_MCU_FUNC_LOWPOWER_MODE = 51, TUYA_MCU_FUNC_LAST = 255
};
#endif // _TASMOTA_H_

View File

@ -73,37 +73,37 @@ struct TUYA {
} Tuya;
enum TuyaSupportedFunctions {
TUYA_MCU_FUNC_NONE,
TUYA_MCU_FUNC_SWT1 = 1, // Buttons
TUYA_MCU_FUNC_SWT2,
TUYA_MCU_FUNC_SWT3,
TUYA_MCU_FUNC_SWT4,
TUYA_MCU_FUNC_REL1 = 11, // Relays
TUYA_MCU_FUNC_REL2,
TUYA_MCU_FUNC_REL3,
TUYA_MCU_FUNC_REL4,
TUYA_MCU_FUNC_REL5,
TUYA_MCU_FUNC_REL6,
TUYA_MCU_FUNC_REL7,
TUYA_MCU_FUNC_REL8,
TUYA_MCU_FUNC_DIMMER = 21,
TUYA_MCU_FUNC_POWER = 31,
TUYA_MCU_FUNC_CURRENT,
TUYA_MCU_FUNC_VOLTAGE,
TUYA_MCU_FUNC_BATTERY_STATE,
TUYA_MCU_FUNC_BATTERY_PERCENTAGE,
TUYA_MCU_FUNC_REL1_INV = 41, // Inverted Relays
TUYA_MCU_FUNC_REL2_INV,
TUYA_MCU_FUNC_REL3_INV,
TUYA_MCU_FUNC_REL4_INV,
TUYA_MCU_FUNC_REL5_INV,
TUYA_MCU_FUNC_REL6_INV,
TUYA_MCU_FUNC_REL7_INV,
TUYA_MCU_FUNC_REL8_INV,
TUYA_MCU_FUNC_LOWPOWER_MODE = 51,
TUYA_MCU_FUNC_LAST = 255
};
// enum TuyaSupportedFunctions {
// TUYA_MCU_FUNC_NONE,
// TUYA_MCU_FUNC_SWT1 = 1, // Buttons
// TUYA_MCU_FUNC_SWT2,
// TUYA_MCU_FUNC_SWT3,
// TUYA_MCU_FUNC_SWT4,
// TUYA_MCU_FUNC_REL1 = 11, // Relays
// TUYA_MCU_FUNC_REL2,
// TUYA_MCU_FUNC_REL3,
// TUYA_MCU_FUNC_REL4,
// TUYA_MCU_FUNC_REL5,
// TUYA_MCU_FUNC_REL6,
// TUYA_MCU_FUNC_REL7,
// TUYA_MCU_FUNC_REL8,
// TUYA_MCU_FUNC_DIMMER = 21,
// TUYA_MCU_FUNC_POWER = 31,
// TUYA_MCU_FUNC_CURRENT,
// TUYA_MCU_FUNC_VOLTAGE,
// TUYA_MCU_FUNC_BATTERY_STATE,
// TUYA_MCU_FUNC_BATTERY_PERCENTAGE,
// TUYA_MCU_FUNC_REL1_INV = 41, // Inverted Relays
// TUYA_MCU_FUNC_REL2_INV,
// TUYA_MCU_FUNC_REL3_INV,
// TUYA_MCU_FUNC_REL4_INV,
// TUYA_MCU_FUNC_REL5_INV,
// TUYA_MCU_FUNC_REL6_INV,
// TUYA_MCU_FUNC_REL7_INV,
// TUYA_MCU_FUNC_REL8_INV,
// TUYA_MCU_FUNC_LOWPOWER_MODE = 51,
// TUYA_MCU_FUNC_LAST = 255
// };
const char kTuyaCommand[] PROGMEM = "|" // No prefix
D_CMND_TUYA_MCU "|" D_CMND_TUYA_MCU_SEND_STATE;