|
|
@ -10,6 +10,7 @@ class Device:
|
|
|
|
"""Initialize GeoRideTracker device."""
|
|
|
|
"""Initialize GeoRideTracker device."""
|
|
|
|
self._tracker: GeoRideTracker = tracker
|
|
|
|
self._tracker: GeoRideTracker = tracker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def tracker(self):
|
|
|
|
def tracker(self):
|
|
|
|
"""return the tracker"""
|
|
|
|
"""return the tracker"""
|
|
|
@ -20,11 +21,26 @@ class Device:
|
|
|
|
"""Get the name."""
|
|
|
|
"""Get the name."""
|
|
|
|
return self._tracker.tracker_name
|
|
|
|
return self._tracker.tracker_name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def default_manufacturer(self) -> str:
|
|
|
|
|
|
|
|
"""Get the default_manufacturer."""
|
|
|
|
|
|
|
|
return "GeoRide"
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def manufacturer(self) -> str:
|
|
|
|
def manufacturer(self) -> str:
|
|
|
|
"""Get the manufacturer."""
|
|
|
|
"""Get the manufacturer."""
|
|
|
|
return "GeoRide"
|
|
|
|
return "GeoRide"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def default_model(self) -> str:
|
|
|
|
|
|
|
|
"""Get the default model."""
|
|
|
|
|
|
|
|
return "GeoRide 1"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def suggested_area(self) -> str:
|
|
|
|
|
|
|
|
"""Get the suggested_area."""
|
|
|
|
|
|
|
|
return "Garage"
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def model_name(self) -> str:
|
|
|
|
def model_name(self) -> str:
|
|
|
|
"""Get the model name."""
|
|
|
|
"""Get the model name."""
|
|
|
@ -34,28 +50,42 @@ class Device:
|
|
|
|
elif self._tracker.version == 2:
|
|
|
|
elif self._tracker.version == 2:
|
|
|
|
name = "GeoRide 2"
|
|
|
|
name = "GeoRide 2"
|
|
|
|
elif self._tracker.version == 3:
|
|
|
|
elif self._tracker.version == 3:
|
|
|
|
name = "GeoRide 3"
|
|
|
|
if self._tracker.model == 'georide-3':
|
|
|
|
|
|
|
|
name = "GeoRide 3"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
name = "GeoRide Mini"
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
name = "Prototype / Unknown"
|
|
|
|
name = "Prototype / Unknown"
|
|
|
|
return name
|
|
|
|
return name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def sw_version(self) -> str:
|
|
|
|
|
|
|
|
"""Get the software version."""
|
|
|
|
|
|
|
|
return str(self._tracker.software_version)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def hw_version(self) -> str:
|
|
|
|
|
|
|
|
"""Get the hardware version."""
|
|
|
|
|
|
|
|
return str(self._tracker.version)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def unique_id(self) -> str:
|
|
|
|
|
|
|
|
"""Get the unique id."""
|
|
|
|
|
|
|
|
return {(GEORIDE_DOMAIN, self._tracker.tracker_id)}
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def device_info(self):
|
|
|
|
def device_info(self):
|
|
|
|
"""Return the device info."""
|
|
|
|
"""Return the device info."""
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"name": self.name,
|
|
|
|
"name": self.name,
|
|
|
|
"identifiers": self.unique_id,
|
|
|
|
"identifiers": self.unique_id,
|
|
|
|
"manufacturer": "GeoRide",
|
|
|
|
"manufacturer": self.manufacturer,
|
|
|
|
"model": self.model_name,
|
|
|
|
"model": self.model_name,
|
|
|
|
"suggested_area": "Garage"
|
|
|
|
"suggested_area": self.suggested_area,
|
|
|
|
|
|
|
|
"sw_version" : self.sw_version,
|
|
|
|
|
|
|
|
"hw_version": self.hw_version
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def unique_id(self) -> str:
|
|
|
|
|
|
|
|
"""Get the unique id."""
|
|
|
|
|
|
|
|
return {(GEORIDE_DOMAIN, self._tracker.tracker_id)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __str__(self) -> str:
|
|
|
|
def __str__(self) -> str:
|
|
|
|
"""Get string representation."""
|
|
|
|
"""Get string representation."""
|
|
|
|
return f"GeoRide Device: {self.name}::{self.model_name}::{self.unique_id}"
|
|
|
|
return f"GeoRide Device: {self.name}::{self.model_name}::{self.unique_id}"
|
|
|
@ -77,34 +107,54 @@ class DeviceBeacon:
|
|
|
|
"""Get the name."""
|
|
|
|
"""Get the name."""
|
|
|
|
return self._beacon.name
|
|
|
|
return self._beacon.name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def default_manufacturer(self) -> str:
|
|
|
|
|
|
|
|
"""Get the default_manufacturer."""
|
|
|
|
|
|
|
|
return "GeoRide"
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def manufacturer(self) -> str:
|
|
|
|
def manufacturer(self) -> str:
|
|
|
|
"""Get the manufacturer."""
|
|
|
|
"""Get the manufacturer."""
|
|
|
|
return "GeoRide"
|
|
|
|
return "GeoRide"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def default_model(self) -> str:
|
|
|
|
|
|
|
|
"""Get the default model."""
|
|
|
|
|
|
|
|
return "GeoRide Beacon"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def suggested_area(self) -> str:
|
|
|
|
|
|
|
|
"""Get the suggested_area."""
|
|
|
|
|
|
|
|
return "Garage"
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def model_name(self) -> str:
|
|
|
|
def model_name(self) -> str:
|
|
|
|
"""Get the model name."""
|
|
|
|
"""Get the model name."""
|
|
|
|
name = "GeoRide Beacon"
|
|
|
|
name = "GeoRide Beacon"
|
|
|
|
return name
|
|
|
|
return name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def unique_id(self) -> str:
|
|
|
|
|
|
|
|
"""Get the unique id."""
|
|
|
|
|
|
|
|
return {(GEORIDE_DOMAIN, self._beacon.beacon_id)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def via_device(self) -> str:
|
|
|
|
|
|
|
|
"""Get the unique id."""
|
|
|
|
|
|
|
|
return (GEORIDE_DOMAIN, self._beacon.linked_tracker_id )
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def device_info(self):
|
|
|
|
def device_info(self):
|
|
|
|
"""Return the device info."""
|
|
|
|
"""Return the device info."""
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"name": self.name,
|
|
|
|
"name": self.name,
|
|
|
|
"identifiers": self.unique_id,
|
|
|
|
"identifiers": self.unique_id,
|
|
|
|
"manufacturer": "GeoRide",
|
|
|
|
"manufacturer": self.manufacturer,
|
|
|
|
"model": self.model_name,
|
|
|
|
"model": self.model_name,
|
|
|
|
"suggested_area": "Garage"
|
|
|
|
"suggested_area": self.suggested_area,
|
|
|
|
|
|
|
|
"via_device": self.via_device
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def unique_id(self) -> str:
|
|
|
|
|
|
|
|
"""Get the unique id."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {(GEORIDE_DOMAIN, self._beacon.beacon_id)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __str__(self) -> str:
|
|
|
|
def __str__(self) -> str:
|
|
|
|
"""Get string representation."""
|
|
|
|
"""Get string representation."""
|
|
|
|
return f"GeoRide Device: {self.name}::{self.model_name}::{self.unique_id}"
|
|
|
|
return f"GeoRide Device: {self.name}::{self.model_name}::{self.unique_id}"
|