1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-16 02:02:21 +01:00

Add missing state attribute (#851)

* Add api missing_state attribute

Fixes https://github.com/esphome/issues/issues/828

Adds a new property for missing state, so that HA can now when a sensor does not have a state yet.

* Update api.proto
This commit is contained in:
Otto Winter
2019-11-12 18:58:26 +01:00
committed by GitHub
parent fad05d5a2e
commit fb055750df
5 changed files with 62 additions and 15 deletions

View File

@@ -216,6 +216,9 @@ message BinarySensorStateResponse {
fixed32 key = 1;
bool state = 2;
// If the binary sensor does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3;
}
// ==================== COVER ====================
@@ -416,6 +419,9 @@ message SensorStateResponse {
fixed32 key = 1;
float state = 2;
// If the sensor does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3;
}
// ==================== SWITCH ====================
@@ -472,6 +478,9 @@ message TextSensorStateResponse {
fixed32 key = 1;
string state = 2;
// If the text sensor does not have a valid state yet.
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
bool missing_state = 3;
}
// ==================== SUBSCRIBE LOGS ====================