binary sensor
This commit is contained in:
parent
1ba53cbb6d
commit
6a4a203e77
|
@ -53,7 +53,20 @@ namespace ratgdo {
|
|||
traits.set_is_assumed_state(false);
|
||||
return traits;
|
||||
}
|
||||
void RATGDOCover::control(const CoverCall& call) { }
|
||||
void RATGDOCover::control(const CoverCall& call)
|
||||
{
|
||||
if (call.get_stop()) {
|
||||
this->parent_->stopDoor();
|
||||
}
|
||||
if (call.get_position().has_value()) {
|
||||
auto pos = *call.get_position();
|
||||
if (pos == COVER_OPEN) {
|
||||
this->parent_->openDoor();
|
||||
} else if (pos == COVER_CLOSED) {
|
||||
this->parent_->closeDoor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ratgdo
|
||||
} // namespace esphome
|
||||
|
|
Loading…
Reference in New Issue