mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2025-01-13 20:11:42 +01:00
Add missing_state property
This commit is contained in:
parent
a30e6c2f8c
commit
91b2e0ceb4
@ -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 ====================
|
||||
|
File diff suppressed because one or more lines are too long
@ -50,6 +50,7 @@ class BinarySensorInfo(EntityInfo):
|
||||
@attr.s
|
||||
class BinarySensorState(EntityState):
|
||||
state = attr.ib(type=bool, default=False)
|
||||
missing_state = attr.ib(type=bool, default=False)
|
||||
|
||||
|
||||
# ==================== COVER ====================
|
||||
@ -149,6 +150,7 @@ class SensorInfo(EntityInfo):
|
||||
@attr.s
|
||||
class SensorState(EntityState):
|
||||
state = attr.ib(type=float, default=0.0)
|
||||
missing_state = attr.ib(type=bool, default=False)
|
||||
|
||||
|
||||
# ==================== SWITCH ====================
|
||||
@ -172,6 +174,7 @@ class TextSensorInfo(EntityInfo):
|
||||
@attr.s
|
||||
class TextSensorState(EntityState):
|
||||
state = attr.ib(type=str, default='')
|
||||
missing_state = attr.ib(type=bool, default=False)
|
||||
|
||||
|
||||
# ==================== CAMERA ====================
|
||||
|
Loading…
Reference in New Issue
Block a user