mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-12-06 18:44:14 -05:00
Dynamically handle devices and other enhancements
This commit is contained in:
@@ -7,7 +7,7 @@ import base64
|
||||
from datetime import UTC, datetime
|
||||
import logging
|
||||
import ssl
|
||||
from typing import Any, Final
|
||||
from typing import Any, Final, Iterable
|
||||
|
||||
import aiomqtt
|
||||
|
||||
@@ -92,6 +92,11 @@ class OasisMqttClient(OasisClientProtocol):
|
||||
"Could not schedule subscription for %s (no running loop)", serial
|
||||
)
|
||||
|
||||
def register_devices(self, devices: Iterable[OasisDevice]) -> None:
|
||||
"""Convenience method to register multiple devices."""
|
||||
for device in devices:
|
||||
self.register_device(device)
|
||||
|
||||
def unregister_device(self, device: OasisDevice) -> None:
|
||||
serial = device.serial_number
|
||||
if not serial:
|
||||
@@ -260,6 +265,13 @@ class OasisMqttClient(OasisClientProtocol):
|
||||
|
||||
return device.mac_address
|
||||
|
||||
async def async_send_auto_clean_command(
|
||||
self, device: OasisDevice, auto_clean: bool
|
||||
) -> None:
|
||||
"""Send auto clean command."""
|
||||
payload = f"WRIAUTOCLEAN={1 if auto_clean else 0}"
|
||||
await self._publish_command(device, payload)
|
||||
|
||||
async def async_send_ball_speed_command(
|
||||
self,
|
||||
device: OasisDevice,
|
||||
|
||||
Reference in New Issue
Block a user