Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions aioesphomeapi/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,13 @@ message CameraImageRequest {
bool stream = 2;
}

// ==================== TEMPERATURE UNIT ====================
enum TemperatureUnit {
TEMPERATURE_UNIT_CELSIUS = 0;
TEMPERATURE_UNIT_FAHRENHEIT = 1;
TEMPERATURE_UNIT_KELVIN = 2;
}

// ==================== CLIMATE ====================
enum ClimateMode {
CLIMATE_MODE_OFF = 0;
Expand Down Expand Up @@ -1110,6 +1117,7 @@ message ListEntitiesClimateResponse {
float visual_max_humidity = 25;
uint32 device_id = 26 [(field_ifdef) = "USE_DEVICES"];
uint32 feature_flags = 27;
Comment thread
bdraco marked this conversation as resolved.
TemperatureUnit temperature_unit = 28;
}
message ClimateStateResponse {
option (id) = 47;
Expand Down Expand Up @@ -1203,6 +1211,7 @@ message ListEntitiesWaterHeaterResponse {
repeated WaterHeaterMode supported_modes = 11 [(container_pointer_no_template) = "water_heater::WaterHeaterModeMask"];
// Bitmask of WaterHeaterFeature flags
uint32 supported_features = 12;
TemperatureUnit temperature_unit = 13;
}

message WaterHeaterStateResponse {
Expand Down
610 changes: 306 additions & 304 deletions aioesphomeapi/api_pb2.py

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions aioesphomeapi/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,12 @@ class ClimatePreset(APIIntEnum):
ACTIVITY = 7


class TemperatureUnit(APIIntEnum):
CELSIUS = 0
FAHRENHEIT = 1
KELVIN = 2


@_frozen_dataclass_decorator
class ClimateInfo(EntityInfo):
feature_flags: int = 0
Expand Down Expand Up @@ -733,6 +739,10 @@ class ClimateInfo(EntityInfo):
supports_target_humidity: bool = False
visual_min_humidity: float = 0
visual_max_humidity: float = 0
temperature_unit: TemperatureUnit | None = converter_field(
default=None,
converter=TemperatureUnit.convert,
)

def supported_feature_flags_compat(self, api_version: APIVersion) -> int:
if api_version < APIVersion(1, 13):
Expand Down Expand Up @@ -1183,6 +1193,10 @@ class WaterHeaterInfo(EntityInfo):
default_factory=list, converter=WaterHeaterMode.convert_list
)
supported_features: int = 0
temperature_unit: TemperatureUnit | None = converter_field(
default=None,
converter=TemperatureUnit.convert,
)


@_frozen_dataclass_decorator
Expand Down
Loading