@@ -399,6 +399,8 @@ void IRMitsubishiAC::setTemp(const float degrees) {
399399 // Do we have a half degree celsius?
400400 _.HalfDegree = nrHalfDegrees & 1 ;
401401 _.Temp = static_cast <uint8_t >(nrHalfDegrees / 2 - kMitsubishiAcMinTemp );
402+ // If temp is modified, iSave10C cannot be ON (because temp is then > 10C)
403+ setISave10C (false );
402404}
403405
404406// / Get the current temperature setting.
@@ -452,8 +454,104 @@ void IRMitsubishiAC::setMode(const uint8_t mode) {
452454 return ;
453455 }
454456 _.Mode = mode;
457+ // iSave10C can only be on in Heat mode.
458+ if (mode != kMitsubishiAcHeat ) {
459+ setISave10C (false );
460+ }
461+ }
462+
463+ // / Set the iSave10C (i-SAVE) mode of the A/C.
464+ // / @param[in] state true, the setting is on. false, the setting is off.
465+ // / @note Normal minimum temp is 16C; i-SAVE mode works as gate to enable AC
466+ // / to use 10C as setting. However, when Remote control shows 10C, it still
467+ // / emits 16C on the "Temp" bits, and instead it uses other bits to indicate
468+ // / a target temp of 10C.
469+ // / Slightly strange, but I guess it's to keep compatibility to systems
470+ // / without i-SAVE.
471+ // / i-SAVE only has this 10C functionality when the AC is already in Heat mode.
472+ // / In all other modes, minimum temp is 16C.
473+ // / I have found no other difference between normal Heat mode and i-SAVE
474+ // / other than the ability to go to 10C.
475+ // / In this implementation, i-SAVE mode is ONLY used to enable the AC
476+ // / temperature setting to 10C. Therefore "Temp" is set to 16 disregarding
477+ // / what the remote shows, and mode is set to Heat.
478+ void IRMitsubishiAC::setISave10C (const bool state) {
479+ if (state) setMode (kMitsubishiAcHeat );
480+ if (state) setTemp (kMitsubishiAcMinTemp );
481+ _.iSave10C = state;
482+ }
483+
484+ // / Get the iSave10C (i-SAVE) mode of the A/C.
485+ // / @return true, the setting is on. false, the setting is off.
486+ bool IRMitsubishiAC::getISave10C (void ) const {
487+ return _.iSave10C ;
488+ }
489+
490+ // / Set the requested iSee mode.
491+ // / @param[in] state requested iSee mode.
492+ void IRMitsubishiAC::setISee (const bool state) {
493+ _.ISee = state;
494+ }
495+
496+ // / Get the iSee mode of the A/C.
497+ // / @return The iSee mode setting.
498+ bool IRMitsubishiAC::getISee (void ) const {
499+ return _.ISee ;
500+ }
501+
502+ // / Set the requested Ecocool mode.
503+ // / @param[in] state requested Ecocool mode.
504+ void IRMitsubishiAC::setEcocool (const bool state) {
505+ _.Ecocool = state;
506+ }
507+
508+ // / Get the Ecocool mode of the A/C.
509+ // / @return The Ecocool mode setting.
510+ bool IRMitsubishiAC::getEcocool (void ) const {
511+ return _.Ecocool ;
512+ }
513+
514+ // / Set the requested Absense Detect mode.
515+ // / @param[in] state requested Absense Detect mode.
516+ void IRMitsubishiAC::setAbsenseDetect (const bool state) {
517+ _.AbsenseDetect = state;
518+ }
519+
520+ // / Get the Absense Detect mode of the A/C.
521+ // / @return The Absense Detect mode setting.
522+ bool IRMitsubishiAC::getAbsenseDetect (void ) const {
523+ return _.AbsenseDetect ;
524+ }
525+
526+ // / Set the requested Direct/Indirect mode. Only works if I-See mode is ON.
527+ // / @param[in] mode requested Direct/Indirect mode.
528+ void IRMitsubishiAC::setDirectIndirect (const uint8_t mode) {
529+ if (_.ISee ) {
530+ _.DirectIndirect = std::min (mode, kMitsubishiAcDirect ); // bounds check
531+ } else {
532+ _.DirectIndirect = 0 ;
533+ }
534+ }
535+
536+ // / Get the Direct/Indirect mode of the A/C.
537+ // / @return The native mode setting.
538+ uint8_t IRMitsubishiAC::getDirectIndirect (void ) const {
539+ return _.DirectIndirect ;
540+ }
541+
542+ // / Set the requested Natural Flow mode.
543+ // / @param[in] state requested Natural Flow mode.
544+ void IRMitsubishiAC::setNaturalFlow (const bool state) {
545+ _.NaturalFlow = state;
546+ }
547+
548+ // / Get the Natural Flow mode of the A/C.
549+ // / @return The Natural Flow mode setting.
550+ bool IRMitsubishiAC::getNaturalFlow (void ) const {
551+ return _.NaturalFlow ;
455552}
456553
554+
457555// / Set the requested vane (Vertical Swing) operation mode of the a/c unit.
458556// / @note On some models, this represents the Right vertical vane.
459557// / @param[in] position The position/mode to set the vane to.
@@ -463,25 +561,13 @@ void IRMitsubishiAC::setVane(const uint8_t position) {
463561 _.Vane = pos;
464562}
465563
466- // / Set the requested wide-vane (Horizontal Swing) operation mode of the a/c.
467- // / @param[in] position The position/mode to set the wide vane to.
468- void IRMitsubishiAC::setWideVane (const uint8_t position) {
469- _.WideVane = std::min (position, kMitsubishiAcWideVaneAuto );
470- }
471-
472564// / Get the Vane (Vertical Swing) mode of the A/C.
473565// / @note On some models, this represents the Right vertical vane.
474566// / @return The native position/mode setting.
475567uint8_t IRMitsubishiAC::getVane (void ) const {
476568 return _.Vane ;
477569}
478570
479- // / Get the Wide Vane (Horizontal Swing) mode of the A/C.
480- // / @return The native position/mode setting.
481- uint8_t IRMitsubishiAC::getWideVane (void ) const {
482- return _.WideVane ;
483- }
484-
485571// / Set the requested Left Vane (Vertical Swing) operation mode of the a/c unit.
486572// / @param[in] position The position/mode to set the vane to.
487573void IRMitsubishiAC::setVaneLeft (const uint8_t position) {
@@ -492,6 +578,18 @@ void IRMitsubishiAC::setVaneLeft(const uint8_t position) {
492578// / @return The native position/mode setting.
493579uint8_t IRMitsubishiAC::getVaneLeft (void ) const { return _.VaneLeft ; }
494580
581+ // / Set the requested wide-vane (Horizontal Swing) operation mode of the a/c.
582+ // / @param[in] position The position/mode to set the wide vane to.
583+ void IRMitsubishiAC::setWideVane (const uint8_t position) {
584+ _.WideVane = std::min (position, kMitsubishiAcWideVaneAuto );
585+ }
586+
587+ // / Get the Wide Vane (Horizontal Swing) mode of the A/C.
588+ // / @return The native position/mode setting.
589+ uint8_t IRMitsubishiAC::getWideVane (void ) const {
590+ return _.WideVane ;
591+ }
592+
495593// / Get the clock time of the A/C unit.
496594// / @return Nr. of 10 minute increments past midnight.
497595// / @note 1 = 1/6 hour (10 minutes). e.g. 4pm = 48.
@@ -777,6 +875,12 @@ String IRMitsubishiAC::toString(void) const {
777875 result += ' )' ;
778876 }
779877 result += addBoolToString (_.WeeklyTimer , kWeeklyTimerStr );
878+ result += addBoolToString (_.iSave10C , k10CHeatStr);
879+ result += addBoolToString (_.ISee , kISeeStr );
880+ result += addBoolToString (_.Ecocool , kEconoStr );
881+ result += addBoolToString (_.AbsenseDetect , kAbsenseDetectStr );
882+ result += addIntToString (_.DirectIndirect , kDirectIndirectModeStr );
883+ result += addBoolToString (_.NaturalFlow , kFreshStr );
780884 return result;
781885}
782886
0 commit comments