Skip to content

Commit

Permalink
Fujitsu: Add support for timers. (crankyoldgit#1262)
Browse files Browse the repository at this point in the history
* Add Sleep, On, & Off timer support.
* Remove `this->` from Fujitsu code base.
* Add unit test coverage for Timers.
* Update existing Unit tests.
* Misc other code style cleanup.

Fixes crankyoldgit#1261
Fixes crankyoldgit#1255
  • Loading branch information
crankyoldgit authored Sep 6, 2020
1 parent aff9cc3 commit 7e84ab7
Show file tree
Hide file tree
Showing 6 changed files with 381 additions and 81 deletions.
6 changes: 4 additions & 2 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,13 @@ void IRac::electra(IRElectraAc *ac,
/// @param[in] econo Run the device in economical mode.
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
/// @param[in] sleep Nr. of minutes for sleep mode. <= 0 is Off, > 0 is on.
void IRac::fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
const bool on, const stdAc::opmode_t mode,
const float degrees, const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
const bool quiet, const bool turbo, const bool econo,
const bool filter, const bool clean) {
const bool filter, const bool clean, const int16_t sleep) {
ac->begin();
ac->setModel(model);
if (on) {
Expand Down Expand Up @@ -890,6 +891,7 @@ void IRac::fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
ac->setFilter(filter);
ac->setClean(clean);
// No Beep setting available.
ac->setSleepTimer(sleep > 0 ? sleep : 0);
// No Sleep setting available.
// No Clock setting available.
ac->on(); // Ref: Issue #860
Expand Down Expand Up @@ -1009,7 +1011,7 @@ void IRac::haier(IRHaierAC *ac,
// No Clean setting available.
// No Beep setting available.
ac->setSleep(sleep >= 0); // Sleep on this A/C is either on or off.
if (clock >=0) ac->setCurrTime(clock);
if (clock >= 0) ac->setCurrTime(clock);
if (on)
ac->setCommand(kHaierAcCmdOn);
else
Expand Down
2 changes: 1 addition & 1 deletion src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void electra(IRElectraAc *ac,
const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
const bool quiet, const bool turbo, const bool econo,
const bool filter, const bool clean);
const bool filter, const bool clean, const int16_t sleep = -1);
#endif // SEND_FUJITSU_AC
#if SEND_GOODWEATHER
void goodweather(IRGoodweatherAc *ac,
Expand Down
Loading

0 comments on commit 7e84ab7

Please sign in to comment.