mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-09-27 04:22:46 +02:00
Add 'icon' field to Binary Sensor, Climate, Cover, Fan, and Light (#106)
* Added light icon to API * Added icon property to Binary Sensor, Climate, Cover, and Fan entities
This commit is contained in:
parent
b3d5d376fb
commit
c46d1c3822
@ -216,6 +216,7 @@ message ListEntitiesBinarySensorResponse {
|
|||||||
string device_class = 5;
|
string device_class = 5;
|
||||||
bool is_status_binary_sensor = 6;
|
bool is_status_binary_sensor = 6;
|
||||||
bool disabled_by_default = 7;
|
bool disabled_by_default = 7;
|
||||||
|
string icon = 8;
|
||||||
}
|
}
|
||||||
message BinarySensorStateResponse {
|
message BinarySensorStateResponse {
|
||||||
option (id) = 21;
|
option (id) = 21;
|
||||||
@ -246,6 +247,7 @@ message ListEntitiesCoverResponse {
|
|||||||
bool supports_tilt = 7;
|
bool supports_tilt = 7;
|
||||||
string device_class = 8;
|
string device_class = 8;
|
||||||
bool disabled_by_default = 9;
|
bool disabled_by_default = 9;
|
||||||
|
string icon = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LegacyCoverState {
|
enum LegacyCoverState {
|
||||||
@ -314,6 +316,7 @@ message ListEntitiesFanResponse {
|
|||||||
bool supports_direction = 7;
|
bool supports_direction = 7;
|
||||||
int32 supported_speed_levels = 8;
|
int32 supported_speed_levels = 8;
|
||||||
bool disabled_by_default = 9;
|
bool disabled_by_default = 9;
|
||||||
|
string icon = 10;
|
||||||
}
|
}
|
||||||
enum FanSpeed {
|
enum FanSpeed {
|
||||||
FAN_SPEED_LOW = 0;
|
FAN_SPEED_LOW = 0;
|
||||||
@ -377,6 +380,7 @@ message ListEntitiesLightResponse {
|
|||||||
float max_mireds = 10;
|
float max_mireds = 10;
|
||||||
repeated string effects = 11;
|
repeated string effects = 11;
|
||||||
bool disabled_by_default = 13;
|
bool disabled_by_default = 13;
|
||||||
|
string icon = 14;
|
||||||
}
|
}
|
||||||
message LightStateResponse {
|
message LightStateResponse {
|
||||||
option (id) = 24;
|
option (id) = 24;
|
||||||
@ -778,6 +782,7 @@ message ListEntitiesClimateResponse {
|
|||||||
repeated ClimatePreset supported_presets = 16;
|
repeated ClimatePreset supported_presets = 16;
|
||||||
repeated string supported_custom_presets = 17;
|
repeated string supported_custom_presets = 17;
|
||||||
bool disabled_by_default = 18;
|
bool disabled_by_default = 18;
|
||||||
|
string icon = 19;
|
||||||
}
|
}
|
||||||
message ClimateStateResponse {
|
message ClimateStateResponse {
|
||||||
option (id) = 47;
|
option (id) = 47;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -113,6 +113,7 @@ class EntityInfo(APIModelBase):
|
|||||||
name: str = ""
|
name: str = ""
|
||||||
unique_id: str = ""
|
unique_id: str = ""
|
||||||
disabled_by_default: bool = False
|
disabled_by_default: bool = False
|
||||||
|
icon: str = ""
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
@ -316,7 +317,6 @@ class LastResetType(APIIntEnum):
|
|||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class SensorInfo(EntityInfo):
|
class SensorInfo(EntityInfo):
|
||||||
icon: str = ""
|
|
||||||
device_class: str = ""
|
device_class: str = ""
|
||||||
unit_of_measurement: str = ""
|
unit_of_measurement: str = ""
|
||||||
accuracy_decimals: int = 0
|
accuracy_decimals: int = 0
|
||||||
@ -338,7 +338,6 @@ class SensorState(EntityState):
|
|||||||
# ==================== SWITCH ====================
|
# ==================== SWITCH ====================
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class SwitchInfo(EntityInfo):
|
class SwitchInfo(EntityInfo):
|
||||||
icon: str = ""
|
|
||||||
assumed_state: bool = False
|
assumed_state: bool = False
|
||||||
|
|
||||||
|
|
||||||
@ -350,7 +349,7 @@ class SwitchState(EntityState):
|
|||||||
# ==================== TEXT SENSOR ====================
|
# ==================== TEXT SENSOR ====================
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class TextSensorInfo(EntityInfo):
|
class TextSensorInfo(EntityInfo):
|
||||||
icon: str = ""
|
pass
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
@ -506,7 +505,6 @@ class ClimateState(EntityState):
|
|||||||
# ==================== NUMBER ====================
|
# ==================== NUMBER ====================
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class NumberInfo(EntityInfo):
|
class NumberInfo(EntityInfo):
|
||||||
icon: str = ""
|
|
||||||
min_value: float = 0.0
|
min_value: float = 0.0
|
||||||
max_value: float = 0.0
|
max_value: float = 0.0
|
||||||
step: float = converter_field(
|
step: float = converter_field(
|
||||||
@ -525,7 +523,6 @@ class NumberState(EntityState):
|
|||||||
# ==================== SELECT ====================
|
# ==================== SELECT ====================
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class SelectInfo(EntityInfo):
|
class SelectInfo(EntityInfo):
|
||||||
icon: str = ""
|
|
||||||
options: List[str] = converter_field(default_factory=list, converter=list)
|
options: List[str] = converter_field(default_factory=list, converter=list)
|
||||||
|
|
||||||
|
|
||||||
@ -538,7 +535,6 @@ class SelectState(EntityState):
|
|||||||
# ==================== SIREN ====================
|
# ==================== SIREN ====================
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class SirenInfo(EntityInfo):
|
class SirenInfo(EntityInfo):
|
||||||
icon: str = ""
|
|
||||||
tones: List[str] = converter_field(default_factory=list, converter=list)
|
tones: List[str] = converter_field(default_factory=list, converter=list)
|
||||||
supports_volume: bool = False
|
supports_volume: bool = False
|
||||||
supports_duration: bool = False
|
supports_duration: bool = False
|
||||||
|
Loading…
Reference in New Issue
Block a user