A few fixes

This commit is contained in:
Jesse Hills 2024-04-10 04:09:29 +00:00
parent b5aa9029a0
commit fbeca664e3
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A
3 changed files with 4 additions and 11 deletions

View File

@ -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,

View File

@ -372,6 +372,6 @@ MESSAGE_TYPE_TO_PROTO = {
105: TimeCommandRequest,
106: VoiceAssistantAudio,
109: ListEntitiesValveResponse,
110: ValveCommandRequest,
111: ValveStateResponse,
110: ValveStateResponse,
111: ValveCommandRequest,
}

View File

@ -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):