From 2793402027f5206160be9e61e2db3aa0c87fe237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bub=C3=ADk?= Date: Sat, 6 Mar 2021 23:05:51 +0100 Subject: [PATCH] PROJECTOR_CTRL: Add WARMING states [NEC] NEC V300W returns undocumented states 0x01 and 0x02 during warming up Consider Projector already powered-up --- tasmota/xdrv_53_projector_ctrl.h | 4 ++++ tasmota/xdrv_53_projector_ctrl.ino | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_53_projector_ctrl.h b/tasmota/xdrv_53_projector_ctrl.h index 347f7a576..4aca0d12b 100644 --- a/tasmota/xdrv_53_projector_ctrl.h +++ b/tasmota/xdrv_53_projector_ctrl.h @@ -35,6 +35,8 @@ static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = { }; #define PROJECTOR_CTRL_QRYPWR_ON 0x04 #define PROJECTOR_CTRL_QRYPWR_COOLING 0x05 +#define PROJECTOR_CTRL_QRYPWR_STARTING 0x01 //undocumented state, seen on V300W +#define PROJECTOR_CTRL_QRYPWR_WARMING 0x02 //undocumented state, seen on V300W #elif defined(USE_PROJECTOR_CTRL_OPTOMA) @@ -59,6 +61,8 @@ static const struct projector_ctrl_command_info_s projector_ctrl_commands[] = { }; #define PROJECTOR_CTRL_QRYPWR_ON 0x31 #define PROJECTOR_CTRL_QRYPWR_COOLING 0x31 //placebo +#define PROJECTOR_CTRL_QRYPWR_STARTING 0x31 //placebo +#define PROJECTOR_CTRL_QRYPWR_WARMING 0x31 //placebo #else diff --git a/tasmota/xdrv_53_projector_ctrl.ino b/tasmota/xdrv_53_projector_ctrl.ino index 9030aff23..433ecbba0 100644 --- a/tasmota/xdrv_53_projector_ctrl.ino +++ b/tasmota/xdrv_53_projector_ctrl.ino @@ -328,11 +328,19 @@ projector_ctrl_loop(struct projector_ctrl_softc_s *sc) break; case PROJECTOR_CTRL_S_IDLE: if ((oldstate==PROJECTOR_CTRL_S_QRY_PWR)&&(sc->sc_ser_result==PROJECTOR_CTRL_R_PASS)){ - if(((sc->sc_ser_value==PROJECTOR_CTRL_QRYPWR_ON)||(sc->sc_ser_value==PROJECTOR_CTRL_QRYPWR_COOLING))&&(sc->sc_dev_state!=PROJECTOR_CTRL_DEV_PWR_ON)){ + if(( (sc->sc_ser_value==PROJECTOR_CTRL_QRYPWR_ON) + ||(sc->sc_ser_value==PROJECTOR_CTRL_QRYPWR_COOLING) + ||(sc->sc_ser_value==PROJECTOR_CTRL_QRYPWR_STARTING) + ||(sc->sc_ser_value==PROJECTOR_CTRL_QRYPWR_WARMING) + )&&(sc->sc_dev_state!=PROJECTOR_CTRL_DEV_PWR_ON)){ sc->sc_dev_state=PROJECTOR_CTRL_DEV_PWR_ON; ExecuteCommandPower(sc->sc_device, POWER_ON, SRC_IGNORE); }; - if(((sc->sc_ser_value!=PROJECTOR_CTRL_QRYPWR_ON)&&(sc->sc_ser_value!=PROJECTOR_CTRL_QRYPWR_COOLING))&&(sc->sc_dev_state!=PROJECTOR_CTRL_DEV_PWR_OFF)){ + if(( (sc->sc_ser_value!=PROJECTOR_CTRL_QRYPWR_ON) + &&(sc->sc_ser_value!=PROJECTOR_CTRL_QRYPWR_COOLING) + &&(sc->sc_ser_value!=PROJECTOR_CTRL_QRYPWR_STARTING) + &&(sc->sc_ser_value!=PROJECTOR_CTRL_QRYPWR_WARMING) + )&&(sc->sc_dev_state!=PROJECTOR_CTRL_DEV_PWR_OFF)){ sc->sc_dev_state=PROJECTOR_CTRL_DEV_PWR_OFF; ExecuteCommandPower(sc->sc_device, POWER_OFF, SRC_IGNORE); };