A modern, fully-typed Python wrapper for the DroneMobile API. Control your Firstech/Compustar remote start system from Python.
The code here is based off of an unsupported API from DroneMobile and is subject to change without notice. The authors claim no responsibility for damages to your vehicle by use of the code within.
- ๐ Secure Authentication - Automatic token management with secure storage
- ๐ Vehicle Control - Start/stop engine, lock/unlock doors, and more
- ๐ Status Monitoring - Get detailed vehicle status information
- ๐ฏ Type Safe - Full type hints for better IDE support
- ๐งช Well Tested - Comprehensive test suite
- ๐ ๏ธ CLI Tool - Command-line interface for quick operations
- ๐ Context Manager - Clean resource management
- ๐ Detailed Logging - Debug and track API interactions
pip install drone_mobileFor development:
pip install drone_mobile[dev]from drone_mobile import DroneMobileClient
# Create a client and authenticate
client = DroneMobileClient("your_email@example.com", "your_password")
# Get all vehicles
vehicles = client.get_vehicles()
# Work with the first vehicle
vehicle = vehicles[0]
print(f"Vehicle: {vehicle.name}")
# Get status
status = vehicle.get_status()
print(f"Running: {status.is_running}")
print(f"Locked: {status.is_locked}")
print(f"Battery: {status.battery_percent}%")
# Control the vehicle
vehicle.start() # Start the engine
vehicle.unlock() # Unlock doors
vehicle.lock() # Lock doors
vehicle.stop() # Stop the enginefrom drone_mobile import DroneMobileClient
# Automatically handles cleanup
with DroneMobileClient("email@example.com", "password") as client:
vehicles = client.get_vehicles()
for vehicle in vehicles:
status = vehicle.get_status()
print(f"{vehicle.name}: {'Running' if status.is_running else 'Stopped'}")from drone_mobile import DroneMobileClient
from drone_mobile.exceptions import (
AuthenticationError,
CommandFailedError,
VehicleNotFoundError
)
try:
client = DroneMobileClient("email@example.com", "password")
vehicle = client.get_vehicle("vehicle_id")
vehicle.start()
except AuthenticationError:
print("Invalid credentials")
except CommandFailedError as e:
print(f"Command failed: {e}")
except VehicleNotFoundError:
print("Vehicle not found")The package includes a CLI tool for quick operations:
# List all vehicles
drone-mobile-demo user@example.com password list
# Show vehicle status
drone-mobile-demo user@example.com password status
# Send commands
drone-mobile-demo user@example.com password cmd start
drone-mobile-demo user@example.com password cmd lock
drone-mobile-demo user@example.com password cmd unlock
drone-mobile-demo user@example.com password cmd stop
# Use verbose logging
drone-mobile-demo -v user@example.com password statusMain client for interacting with the DroneMobile API.
get_vehicles() -> List[Vehicle]- Get all vehiclesget_vehicle(vehicle_id: str) -> Vehicle- Get specific vehicleget_vehicle_status(vehicle_id: str) -> VehicleStatus- Get vehicle statussend_command(device_key: str, command: str) -> CommandResponse- Send command
Represents a vehicle with control methods.
vehicle_id: str- Unique vehicle identifierdevice_key: str- Device key for commandsname: str- Vehicle nameinfo: VehicleInfo- Detailed vehicle information
get_status() -> VehicleStatus- Get current statusstart() -> CommandResponse- Start enginestop() -> CommandResponse- Stop enginelock() -> CommandResponse- Lock doorsunlock() -> CommandResponse- Unlock doorstrunk() -> CommandResponse- Open trunkpanic_on() -> CommandResponse- Activate panicpanic_off() -> CommandResponse- Deactivate panicaux1() -> CommandResponse- Trigger auxiliary 1aux2() -> CommandResponse- Trigger auxiliary 2get_location() -> CommandResponse- Get GPS location
@dataclass
class VehicleStatus:
vehicle_id: str
device_key: str
is_running: bool
is_locked: bool
battery_voltage: Optional[float]
battery_percent: Optional[int]
odometer: Optional[float]
fuel_level: Optional[int]
interior_temperature: Optional[float]
exterior_temperature: Optional[float]
location: Optional[Location]
last_updated: Optional[datetime]
raw_data: Dict[str, Any]@dataclass
class VehicleInfo:
vehicle_id: str
device_key: str
name: str
make: Optional[str]
model: Optional[str]
year: Optional[int]
color: Optional[str]
vin: Optional[str]
raw_data: Dict[str, Any]- Tokens are stored securely in
~/.config/drone_mobile/with restrictive permissions (0600) - Sensitive data is never logged
- Automatic token refresh prevents credential exposure
# Clone the repository
git clone https://github.com/bjhiltbrand/drone_mobile_python.git
cd drone_mobile_python
# Install with development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install# Run all tests
pytest
# Run with coverage
pytest --cov=drone_mobile --cov-report=html
# Run specific test file
pytest tests/test_auth.py# Format code
black drone_mobile/ tests/
# Lint
ruff check drone_mobile/
# Type check
mypy drone_mobile/
# Run all checks
make format lint type-check testIf you're upgrading from version 0.2.x, see CHANGELOG.md for a detailed migration guide.
Quick changes:
- Import
DroneMobileClientinstead ofVehicle - Use
get_vehicles()instead ofgetAllVehicles() - Methods now return typed objects instead of raw dicts
- Token storage moved to
~/.config/drone_mobile/
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Run the test suite
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Original API reverse engineering by the community
- Thanks to all contributors
- ๐ Report bugs
- ๐ก Request features
- ๐ Documentation
This is an unofficial API wrapper and is not affiliated with, endorsed by, or connected to DroneMobile, Firstech, or Compustar in any way.