1 """Remote vehicle services for Subaru integration."""
5 from subarulink.exceptions
import SubaruException
9 from .const
import SERVICE_UNLOCK, VEHICLE_NAME, VEHICLE_VIN
11 _LOGGER = logging.getLogger(__name__)
15 """Execute subarulink remote command."""
16 car_name = vehicle_info[VEHICLE_NAME]
17 vin = vehicle_info[VEHICLE_VIN]
19 _LOGGER.debug(
"Sending %s command command to %s", cmd, car_name)
23 if cmd == SERVICE_UNLOCK:
24 success = await getattr(controller, cmd)(vin, arg)
26 success = await getattr(controller, cmd)(vin)
27 except SubaruException
as err:
31 _LOGGER.debug(
"%s command successfully completed for %s", cmd, car_name)
def async_call_remote_service(controller, cmd, vehicle_info, arg=None)