Skip to content

Location

LocationService

Service class for handling location related operations.

emit_location_update(latitude, longitude, altitude) async classmethod

Emit a location update event to all connected clients and plugins who are listening for location updates.

Parameters:

Name Type Description Default
latitude float

The latitude of the location.

required
longitude float

The longitude of the location.

required
altitude float

The altitude of the location.

required

get_latest_location() classmethod

Get the latest location from the database.

update_location(latitude, longitude, altitude, timestamp) classmethod

Update the location in the database.

Parameters:

Name Type Description Default
latitude float

The latitude of the location.

required
longitude float

The longitude of the location.

required
altitude float

The altitude of the location.

required
timestamp datetime

The timestamp of the location.

required

Returns:

Type Description
Location

The Location object that was created.