mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-09-27 04:22:46 +02:00
A few fixes
This commit is contained in:
parent
b5aa9029a0
commit
fbeca664e3
@ -1164,17 +1164,13 @@ class APIClient:
|
||||
position: float | None = None,
|
||||
stop: bool = False,
|
||||
) -> None:
|
||||
connection = self._get_connection()
|
||||
req = ValveCommandRequest(key=key)
|
||||
apiv = self.api_version
|
||||
if TYPE_CHECKING:
|
||||
assert apiv is not None
|
||||
if position is not None:
|
||||
req.has_position = True
|
||||
req.position = position
|
||||
if stop:
|
||||
req.stop = stop
|
||||
connection.send_message(req)
|
||||
self._get_connection().send_message(req)
|
||||
|
||||
def media_player_command(
|
||||
self,
|
||||
|
@ -372,6 +372,6 @@ MESSAGE_TYPE_TO_PROTO = {
|
||||
105: TimeCommandRequest,
|
||||
106: VoiceAssistantAudio,
|
||||
109: ListEntitiesValveResponse,
|
||||
110: ValveCommandRequest,
|
||||
111: ValveStateResponse,
|
||||
110: ValveStateResponse,
|
||||
111: ValveCommandRequest,
|
||||
}
|
||||
|
@ -756,10 +756,10 @@ class LockEntityState(EntityState):
|
||||
# ==================== VALVE ====================
|
||||
@_frozen_dataclass_decorator
|
||||
class ValveInfo(EntityInfo):
|
||||
device_class: str = ""
|
||||
assumed_state: bool = False
|
||||
supports_stop: bool = False
|
||||
supports_position: bool = False
|
||||
device_class: str = ""
|
||||
|
||||
|
||||
class ValveOperation(APIIntEnum):
|
||||
@ -777,9 +777,6 @@ class ValveState(EntityState):
|
||||
default=ValveOperation.IDLE, converter=ValveOperation.convert
|
||||
)
|
||||
|
||||
def is_closed(self) -> bool:
|
||||
return self.position == 0.0
|
||||
|
||||
|
||||
# ==================== MEDIA PLAYER ====================
|
||||
class MediaPlayerState(APIIntEnum):
|
||||
|
Loading…
Reference in New Issue
Block a user