Update GeoRide trademark wording

This commit is contained in:
2020-05-26 23:46:06 +02:00
parent 1275ffa882
commit 93f089c431
8 changed files with 168 additions and 53 deletions

View File

@@ -5,9 +5,9 @@ import time
import datetime
logging.config.fileConfig('logging.conf')
from georideapilib.objects import GeorideAccount
import georideapilib.api as GeorideApi
from georideapilib.socket import GeorideSocket
from georideapilib.objects import GeoRideAccount
import georideapilib.api as GeoRideApi
from georideapilib.socket import GeoRideSocket
from threading import Thread
@@ -20,17 +20,17 @@ def example():
# account = GeorideAccount(0, "<your_email>", False, token)
account = GeorideApi.get_authorisation_token("<your_email>", "<your_password>")
account = GeoRideApi.get_authorisation_token("<your_email>", "<your_password>")
print("token 1: ", account.auth_token)
_LOGGER.info("token 1: %s", account.auth_token)
# pylint: disable=W0105
def locked_locked(data):
_LOGGER.info("Locke received")
_LOGGER.info("Lock received")
def connect_socket(account):
socket = GeorideSocket()
socket = GeoRideSocket()
socket.subscribe_locked(locked_locked)
socket.init()
socket.connect(account.auth_token)
@@ -45,44 +45,44 @@ def example():
print("token 2: ", account.auth_token)
""" # pylint: disable=W0105
user = GeorideApi.get_user(account.auth_token)
user = GeoRideApi.get_user(account.auth_token)
_LOGGER.info("User: %s", user.first_name)
trackers = GeorideApi.get_trackers(account.auth_token)
trackers = GeoRideApi.get_trackers(account.auth_token)
tracker = trackers[0]
_LOGGER.info("Tracker name: %s", tracker.tracker_name)
trips = GeorideApi.get_trips(account.auth_token, tracker.tracker_id, "2019-10-10", "2019-10-24")
trips = GeoRideApi.get_trips(account.auth_token, tracker.tracker_id, "2019-10-10", "2019-10-24")
trip = trips[0]
trip_date = datetime.datetime.strptime("2019-10-10T06:45:34.000Z", '%Y-%m-%dT%H:%M:%S.%fZ')
_LOGGER.info("Trip date: %s, from: %s, to: %s", trip_date, trip.nice_start_address,
trip.nice_end_address)
positions = GeorideApi.get_positions(account.auth_token, tracker.tracker_id,
positions = GeoRideApi.get_positions(account.auth_token, tracker.tracker_id,
"2019-10-10", "2019-10-24")
position = positions[0]
_LOGGER.info("Position speed: %s, lon: %s, lat: %s", position.speed, position.longitude,
position.latitude)
trip_shared = GeorideApi.share_a_trip_by_date(account.auth_token, tracker.tracker_id,
trip_shared = GeoRideApi.share_a_trip_by_date(account.auth_token, tracker.tracker_id,
"2019-10-10", "2019-10-24")
_LOGGER.info("tripShared url: %s, id: %s", trip_shared.url, trip_shared.share_id)
time.sleep(10)
have_been_locked = GeorideApi.lock_tracker(account.auth_token, tracker.tracker_id)
have_been_locked = GeoRideApi.lock_tracker(account.auth_token, tracker.tracker_id)
_LOGGER.info("Tracker have been locked: %s", have_been_locked)
time.sleep(10)
have_been_unlocked = GeorideApi.unlock_tracker(account.auth_token, tracker.tracker_id)
have_been_unlocked = GeoRideApi.unlock_tracker(account.auth_token, tracker.tracker_id)
_LOGGER.info("Tracker have been unlocked: %s", have_been_unlocked)
time.sleep(10)
is_locked = GeorideApi.toogle_lock_tracker(account.auth_token, tracker.tracker_id)
is_locked = GeoRideApi.toogle_lock_tracker(account.auth_token, tracker.tracker_id)
_LOGGER.info("Tracker is locked: %s", is_locked)
time.sleep(10)
trackers = GeorideApi.get_trackers(account.auth_token)
trackers = GeoRideApi.get_trackers(account.auth_token)
tracker = trackers[0]
_LOGGER.info("Tracker name: %s is locked: %s", tracker.tracker_name, tracker.is_locked)