mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2025-02-17 01:51:23 +01:00
Add mode to number entities (#148)
This commit is contained in:
parent
9d89f377bd
commit
759e2ef133
@ -857,6 +857,11 @@ message ClimateCommandRequest {
|
||||
}
|
||||
|
||||
// ==================== NUMBER ====================
|
||||
enum NumberMode {
|
||||
NUMBER_MODE_AUTO = 0;
|
||||
NUMBER_MODE_BOX = 1;
|
||||
NUMBER_MODE_SLIDER = 2;
|
||||
}
|
||||
message ListEntitiesNumberResponse {
|
||||
option (id) = 49;
|
||||
option (source) = SOURCE_SERVER;
|
||||
@ -874,6 +879,7 @@ message ListEntitiesNumberResponse {
|
||||
bool disabled_by_default = 9;
|
||||
EntityCategory entity_category = 10;
|
||||
string unit_of_measurement = 11;
|
||||
NumberMode mode = 12;
|
||||
}
|
||||
message NumberStateResponse {
|
||||
option (id) = 50;
|
||||
|
File diff suppressed because one or more lines are too long
@ -539,6 +539,12 @@ class ClimateState(EntityState):
|
||||
|
||||
|
||||
# ==================== NUMBER ====================
|
||||
class NumberMode(APIIntEnum):
|
||||
AUTO = 0
|
||||
BOX = 1
|
||||
SLIDER = 2
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class NumberInfo(EntityInfo):
|
||||
min_value: float = converter_field(
|
||||
@ -551,6 +557,9 @@ class NumberInfo(EntityInfo):
|
||||
default=0.0, converter=fix_float_single_double_conversion
|
||||
)
|
||||
unit_of_measurement: str = ""
|
||||
mode: Optional[NumberMode] = converter_field(
|
||||
default=NumberMode.AUTO, converter=NumberMode.convert
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
Loading…
Reference in New Issue
Block a user