Fix small mistakes
This commit is contained in:
@@ -120,8 +120,6 @@ async def async_unload_entry(hass, entry):
|
|||||||
context = hass.data[DOMAIN]["context"]
|
context = hass.data[DOMAIN]["context"]
|
||||||
context.socket.disconnect()
|
context.socket.disconnect()
|
||||||
|
|
||||||
hass.data[DOMAIN]["unsub"]()
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class GeoRideStolenBinarySensorEntity(GeoRideBinarySensorEntity):
|
|||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""state value property"""
|
"""state value property"""
|
||||||
return self._tracker_device.is_stolen
|
return self._tracker_device.tracker.is_stolen
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@@ -120,7 +120,7 @@ class GeoRideActiveSubscriptionBinarySensorEntity(GeoRideBinarySensorEntity):
|
|||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""state value property"""
|
"""state value property"""
|
||||||
if self._tracker.subscription_id is not None:
|
if self._tracker_device.tracker.subscription_id is not None:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,15 @@ class Device:
|
|||||||
"""Initialize GeoRideTracker device."""
|
"""Initialize GeoRideTracker device."""
|
||||||
self._tracker: GeoRideTracker = tracker
|
self._tracker: GeoRideTracker = tracker
|
||||||
|
|
||||||
|
@property
|
||||||
|
def tracker(self):
|
||||||
|
"""return the tracker"""
|
||||||
|
return self._tracker
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self) -> str:
|
def name(self) -> str:
|
||||||
"""Get the name."""
|
"""Get the name."""
|
||||||
return self._tracker.name
|
return self._tracker.tracker_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def manufacturer(self) -> str:
|
def manufacturer(self) -> str:
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class GeoRideTrackerEntity(CoordinatorEntity, TrackerEntity):
|
|||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
"""Return the unique ID."""
|
"""Return the unique ID."""
|
||||||
return f"georide_tracker_{self._tracker.tracker_id}"
|
return f"georide_tracker_{self._tracker_device.tracker.tracker_id}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class GeoRideOdometerSensorEntity(CoordinatorEntity, SensorEntity):
|
|||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
"""Return the unique ID."""
|
"""Return the unique ID."""
|
||||||
return self._tracker_device.tracker.tracker_id
|
return f"odometer_{self._tracker_device.tracker.tracker_id}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
@@ -78,4 +78,4 @@ class GeoRideOdometerSensorEntity(CoordinatorEntity, SensorEntity):
|
|||||||
@property
|
@property
|
||||||
def device_info(self):
|
def device_info(self):
|
||||||
"""Return the device info."""
|
"""Return the device info."""
|
||||||
return self._tracker_device.device_info()
|
return self._tracker_device.device_info
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class GeoRideLockSwitchEntity(CoordinatorEntity, SwitchEntity):
|
|||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
"""Return the unique ID."""
|
"""Return the unique ID."""
|
||||||
return self._tracker.tracker_id
|
return f"lock_{self._tracker_device.tracker_id}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@@ -104,4 +104,4 @@ class GeoRideLockSwitchEntity(CoordinatorEntity, SwitchEntity):
|
|||||||
@property
|
@property
|
||||||
def device_info(self):
|
def device_info(self):
|
||||||
"""Return the device info."""
|
"""Return the device info."""
|
||||||
return self._tracker_device.device_info()
|
return self._tracker_device.device_info
|
||||||
|
|||||||
Reference in New Issue
Block a user