Skip to content

Commit

Permalink
RollerShutter: add getter for current direction (closes #38)
Browse files Browse the repository at this point in the history
  • Loading branch information
klew committed Dec 12, 2022
1 parent 039ef14 commit a4b2004
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/supla/control/roller_shutter.cpp
Expand Up @@ -509,5 +509,9 @@ int RollerShutter::getCurrentPosition() {
return currentPosition;
}

int RollerShutter::getCurrentDirection() {
return currentDirection;
}

}; // namespace Control
}; // namespace Supla
5 changes: 4 additions & 1 deletion src/supla/control/roller_shutter.h
Expand Up @@ -32,7 +32,7 @@
namespace Supla {
namespace Control {

enum Directions { STOP_DIR, DOWN_DIR, UP_DIR };
enum Directions { STOP_DIR = 0, DOWN_DIR = 1, UP_DIR = 2 };

class RollerShutter : public ChannelElement, public ActionHandler {
public:
Expand All @@ -50,6 +50,9 @@ class RollerShutter : public ChannelElement, public ActionHandler {
// (keep motor going down)
void setTargetPosition(int newPosition);
int getCurrentPosition();
// Get current roller shutter movement direction. Returns int value of
// enum Supla::Control::Directions
int getCurrentDirection();

void configComfortUpValue(uint8_t position);
void configComfortDownValue(uint8_t position);
Expand Down

0 comments on commit a4b2004

Please sign in to comment.