1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-15 17:52:19 +01:00

Add support for controlling fan direction (#1051)

* Fix fan oscillation trait not being used

* Add fan direction support to SpeedFan

* Add fan direction to API

* Add fan direction support to BinaryFan

* Fix CI errors

* Fix python format

* Change some ordering to trigger CI

* Add test for the configuration
This commit is contained in:
Jim Persson
2020-06-14 21:54:31 +02:00
committed by GitHub
parent 35a2258f12
commit 0bb81e5b2d
16 changed files with 156 additions and 17 deletions

View File

@@ -301,12 +301,17 @@ message ListEntitiesFanResponse {
bool supports_oscillation = 5;
bool supports_speed = 6;
bool supports_direction = 7;
}
enum FanSpeed {
FAN_SPEED_LOW = 0;
FAN_SPEED_MEDIUM = 1;
FAN_SPEED_HIGH = 2;
}
enum FanDirection {
FAN_DIRECTION_FORWARD = 0;
FAN_DIRECTION_REVERSE = 1;
}
message FanStateResponse {
option (id) = 23;
option (source) = SOURCE_SERVER;
@@ -317,6 +322,7 @@ message FanStateResponse {
bool state = 2;
bool oscillating = 3;
FanSpeed speed = 4;
FanDirection direction = 5;
}
message FanCommandRequest {
option (id) = 31;
@@ -331,6 +337,8 @@ message FanCommandRequest {
FanSpeed speed = 5;
bool has_oscillating = 6;
bool oscillating = 7;
bool has_direction = 8;
FanDirection direction = 9;
}
// ==================== LIGHT ====================