Compare commits

..

29 Commits

Author SHA1 Message Date
91a6c36e80 Update yto v1.1.2 2026-02-05 21:30:07 +01:00
ab64760872 Fix entity_id wronformat since Home assitant 2026.02 2026-02-05 21:14:36 +01:00
djodjo02130
38ceb3a2a1 Add Georide 3S 2025-04-19 22:35:52 +00:00
691b5c2475 Shipping v1.1.1 2024-11-12 20:13:47 +01:00
eea4e1bb6b update to vesion 1.1.1 2024-11-12 20:11:16 +01:00
43b578cd98 Merge pull request #9 from Sigri44/master
Add manual installation
2024-11-12 20:10:57 +01:00
f7d801e1f4 Update deprecated methods and types 2024-11-12 19:49:30 +01:00
6257b65687 Merge pull request #9 from Sigri44/master
Add manual installation
2023-10-29 13:26:04 +01:00
Sigri
cbf81d7438 Add manual installation 2023-10-25 21:19:05 +02:00
Sigri
33d8942e31 Fix syntax 2023-10-25 20:39:23 +02:00
7d08d8f9a7 Shipping v1.1.0 2023-05-24 13:03:59 +02:00
ad77edd103 Update badge and GeoRidelib version 2023-05-24 12:46:26 +02:00
be29b2d9bf Update to georideapilib 0.9.6 2023-03-24 23:17:13 +01:00
f30176cb65 Merge pull request #8 from ptimatth/develop
Shipping v1.0.0
2023-03-18 10:58:58 +01:00
aa6cf7b515 Add beacon verification from the parametter has_beacon unsted of hw version 2023-02-28 19:34:56 +01:00
fa0f67e6ec Update to latest georidelib 2023-02-28 19:23:10 +01:00
e6817e174b Shipping v0.9.1 2022-04-06 17:49:26 +02:00
22047ff6be Shipping v0.9.0 2022-04-06 17:37:16 +02:00
7d809c2105 Shipping v0.8.2 2022-03-03 20:40:02 +01:00
e59c8cb195 Shipping v0.8.1 2021-10-10 13:09:57 +02:00
5af8e7dc5d Shipping v0.8.0, thx to @Inervo 2021-08-30 20:14:56 +02:00
9053f95bc1 Shipping v0.7.2 2021-07-13 20:37:32 +02:00
fc383ff373 Shipping v0.7.1 2021-07-05 18:42:57 +02:00
57abb51b13 Shipping 0.7.0 2021-07-01 11:54:45 +02:00
24180c9345 Shipping v0.6.2 2021-05-05 22:56:38 +02:00
a83bae6d3e Shipping v0.6.1 2021-04-11 18:01:27 +02:00
b84a4cfd7f Shipping v0.6.0 2021-04-11 17:27:23 +02:00
02e1656aab Merge branch 'develop' 2020-12-01 19:24:26 +01:00
9b651f933e Shipping v0.5.0 2020-05-23 15:07:27 +02:00
10 changed files with 44 additions and 42 deletions

View File

@@ -4,6 +4,7 @@
⚠️ This is not an official implementation
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/custom-components/hacs)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg?style=for-the-badge)](https://www.gnu.org/licenses/gpl-3.0)
[![install_badge](https://img.shields.io/badge/dynamic/json?color=41BDF5&logo=home-assistant&label=integration%20usage&suffix=%20installs&cacheSeconds=15600&url=https://analytics.home-assistant.io/custom_integrations.json&query=$.georide.total)](https://analytics.home-assistant.io/)
Official GeoRide website: https://georide.fr/
@@ -101,12 +102,21 @@ mode: single
## Installation
### Option 1
- Just folow the integration config steps.
- Just follow the integration config steps.
### Option 2
- Add the folowing line in your configuration.yml
- Add the following line in your configuration.yml
```yaml
georide:
email: <your-email>@exmple.com
password: <your-password>
```
### Option 3 (manual)
- Download .zip git repo
- Go to /config (with File Editor or SSH)
- Unzip GeorideHA.zip
- Restart Home Assistant
- Go to "Integrations"
- If GeoRide not display, choose "add integration"
- Configure GeoRide add-on

View File

@@ -25,7 +25,6 @@ import homeassistant.helpers.config_validation as cv
import homeassistant.helpers.event as ha_event
from homeassistant.setup import async_when_setup
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
@@ -93,16 +92,7 @@ async def async_setup_entry(hass, entry):
# We add trackers to the context
await context.init_context(hass)
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "device_tracker"))
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "switch"))
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "sensor"))
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "binary_sensor"))
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "siren"))
await hass.config_entries.async_forward_entry_setups(entry, ["device_tracker", "switch", "sensor", "binary_sensor", "siren"])
return True
@@ -306,7 +296,7 @@ class GeoRideContext:
"tracker_device": Device(tracker),
"coordinator": coordinator
}
if tracker.version > 2:
if tracker.has_beacon:
tracker_beacons = await self.get_tracker_beacons_by_tracker_id(tracker.tracker_id)
for tracker_beacon in tracker_beacons:
beacon_coordinator = DataUpdateCoordinator[Mapping[str, Any]](

View File

@@ -58,7 +58,7 @@ class GeoRideBinarySensorEntity(CoordinatorEntity, BinarySensorEntity):
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self.entity_id = f"{ENTITY_ID_FORMAT.format('binary_sensor')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('binary_sensor')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._is_on = False
@property
@@ -74,7 +74,7 @@ class GeoRideBeaconBinarySensorEntity(CoordinatorEntity, BinarySensorEntity):
super().__init__(coordinator)
self._tracker_device_beacon = tracker_device_beacon
self._name = tracker_device_beacon.beacon.name
self.entity_id = f"{ENTITY_ID_FORMAT.format('binary_sensor')}.{tracker_device_beacon.beacon.beacon_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('binary_sensor')}_{tracker_device_beacon.beacon.beacon_id}"# pylint: disable=C0301
self._is_on = False
@property
@@ -92,7 +92,7 @@ class GeoRideStolenBinarySensorEntity(GeoRideBinarySensorEntity):
tracker_device: Device):
"""Set up Georide entity."""
super().__init__(coordinator, tracker_device)
self.entity_id = f"{ENTITY_ID_FORMAT.format('is_stolen')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('is_stolen')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
@property
def unique_id(self):
@@ -122,7 +122,7 @@ class GeoRideCrashedBinarySensorEntity(GeoRideBinarySensorEntity):
tracker_device: Device):
"""Set up Georide entity."""
super().__init__(coordinator, tracker_device)
self.entity_id = f"{ENTITY_ID_FORMAT.format('is_crashed')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('is_crashed')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
@property
def unique_id(self):
@@ -151,7 +151,7 @@ class GeoRideActiveSubscriptionBinarySensorEntity(GeoRideBinarySensorEntity):
tracker_device: Device):
"""Set up Georide entity."""
super().__init__(coordinator, tracker_device)
self.entity_id = f"{ENTITY_ID_FORMAT.format('is_active_subscription_')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('is_active_subscription_')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
@property
def entity_category(self):
@@ -187,7 +187,7 @@ class GeoRideOwnerBinarySensorEntity(GeoRideBinarySensorEntity):
tracker_device: Device):
"""Set up Georide entity."""
super().__init__(coordinator, tracker_device)
self.entity_id = f"{ENTITY_ID_FORMAT.format('is_owner')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('is_owner')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
@property
def unique_id(self):
@@ -213,7 +213,7 @@ class GeoRideNetworkBinarySensorEntity(GeoRideBinarySensorEntity):
tracker_device: Device):
"""Set up Georide entity."""
super().__init__(coordinator, tracker_device)
self.entity_id = f"{ENTITY_ID_FORMAT.format('have_network')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('have_network')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
@property
def entity_category(self):
@@ -253,7 +253,7 @@ class GeoRideMovingBinarySensorEntity(GeoRideBinarySensorEntity):
tracker_device: Device):
"""Set up Georide entity."""
super().__init__(coordinator, tracker_device)
self.entity_id = f"{ENTITY_ID_FORMAT.format('moving')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('moving')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
@property
def entity_category(self):
@@ -294,7 +294,7 @@ class GeoRideUpdatedBinarySensorEntity(GeoRideBinarySensorEntity):
tracker_device: Device):
"""Set up Georide entity."""
super().__init__(coordinator, tracker_device)
self.entity_id = f"{ENTITY_ID_FORMAT.format('update')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('update')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
@property
def unique_id(self):
@@ -326,7 +326,7 @@ class GeoRideBeaconUpdatedBinarySensorEntity(GeoRideBeaconBinarySensorEntity):
tracker_beacon_device: DeviceBeacon):
"""Set up Georide entity."""
super().__init__(coordinator, tracker_beacon_device)
self.entity_id = f"{ENTITY_ID_FORMAT.format('update')}.{tracker_beacon_device.beacon.beacon_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('update')}_{tracker_beacon_device.beacon.beacon_id}"# pylint: disable=C0301
@property
def unique_id(self):

View File

@@ -52,6 +52,8 @@ class Device:
elif self._tracker.version == 3:
if self._tracker.model == 'georide-3':
name = "GeoRide 3"
else if self._tracker.model == 'georide-3s':
name = "GeoRide 3S"
else:
name = "GeoRide Mini"
else:

View File

@@ -3,7 +3,7 @@
import logging
from typing import Any, Mapping
from homeassistant.components.device_tracker.const import DOMAIN, SOURCE_TYPE_GPS
from homeassistant.components.device_tracker.const import DOMAIN, SourceType
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.helpers.update_coordinator import (
@@ -78,7 +78,7 @@ class GeoRideTrackerEntity(CoordinatorEntity, TrackerEntity):
@property
def source_type(self):
"""Return the source type, eg gps or router, of the device."""
return SOURCE_TYPE_GPS
return SourceType.GPS
@property
def location_accuracy(self):

View File

@@ -6,10 +6,10 @@
"issue_tracker": "https://github.com/ptimatth/GeorideHA/issues",
"iot_class": "cloud_polling",
"requirements": [
"georideapilib>=0.9.3",
"georideapilib>=1.0.0",
"pyjwt>=2.2.0"
],
"dependencies": [],
"codeowners": ["ptimatth"],
"version": "1.0.0"
"version": "1.1.2"
}

View File

@@ -57,7 +57,7 @@ class GeoRideOdometerSensorEntity(CoordinatorEntity, SensorEntity):
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self._unit_of_measurement = "m"
self.entity_id = f"{ENTITY_ID_FORMAT.format('odometer')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('odometer')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._state = 0
self._hass = hass
@@ -69,7 +69,7 @@ class GeoRideOdometerSensorEntity(CoordinatorEntity, SensorEntity):
@property
def unique_id(self):
"""Return the unique ID."""
return f"odometer_{self._tracker_device.tracker.tracker_id}"
return f"odometer_{self._tracker_device.tracker.tracker_id}".lower()
@property
def state(self):
@@ -107,14 +107,14 @@ class GeoRideOdometerKmSensorEntity(CoordinatorEntity, SensorEntity):
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self._unit_of_measurement = "km"
self.entity_id = f"{ENTITY_ID_FORMAT.format('odometer_km')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('odometer_km')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._state = 0
self._hass = hass
@property
def unique_id(self):
"""Return the unique ID."""
return f"odometer_km_{self._tracker_device.tracker.tracker_id}"
return f"odometer_km_{self._tracker_device.tracker.tracker_id}".lower()
@property
def state(self):
@@ -152,7 +152,7 @@ class GeoRideSpeedSensorEntity(CoordinatorEntity, SensorEntity):
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self._unit_of_measurement = "km/h"
self.entity_id = f"{ENTITY_ID_FORMAT.format('speed')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('speed')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._state = 0
self._hass = hass
self._state_class = "measurement"
@@ -202,7 +202,7 @@ class GeoRideInternalBatterySensorEntity(CoordinatorEntity, SensorEntity):
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self._unit_of_measurement = "V"
self.entity_id = f"{ENTITY_ID_FORMAT.format('internal_battery_voltage')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('internal_battery_voltage')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._state = 0
self._state_class = "measurement"
self._device_class = "voltage"
@@ -264,7 +264,7 @@ class GeoRideExternalBatterySensorEntity(CoordinatorEntity, SensorEntity):
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self._unit_of_measurement = "V"
self.entity_id = f"{ENTITY_ID_FORMAT.format('external_battery_voltage')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('external_battery_voltage')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._state = 0
self._state_class = "measurement"
self._device_class = "voltage"
@@ -325,7 +325,7 @@ class GeoRideFixtimeSensorEntity(CoordinatorEntity, SensorEntity):
super().__init__(coordinator)
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self.entity_id = f"{ENTITY_ID_FORMAT.format('fixtime')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('fixtime')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._state = 0
self._device_class = "timestamp"
@@ -368,7 +368,7 @@ class GeoRideBeaconBatterySensorEntity(CoordinatorEntity, SensorEntity):
self._tracker_device = tracker_beacon
self._name = tracker_beacon.beacon.name
self._unit_of_measurement = "%"
self.entity_id = f"{ENTITY_ID_FORMAT.format('battery_percent')}.{tracker_beacon.beacon.beacon_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('battery_percent')}_{tracker_beacon.beacon.beacon_id}"# pylint: disable=C0301
self._state = 0
@property

View File

@@ -48,7 +48,7 @@ class GeoRideSirenEntity(CoordinatorEntity, SirenEntity):
super().__init__(coordinator)
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self.entity_id = f"{ENTITY_ID_FORMAT.format('eco_mode')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('eco_mode')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._hass = hass
@property

View File

@@ -48,7 +48,7 @@ class GeoRideLockSwitchEntity(CoordinatorEntity, SwitchEntity):
super().__init__(coordinator)
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self.entity_id = f"{ENTITY_ID_FORMAT.format('lock')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('lock')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._hass = hass
@property
@@ -120,7 +120,7 @@ class GeoRideEcoModeSwitchEntity(CoordinatorEntity, SwitchEntity):
super().__init__(coordinator)
self._tracker_device = tracker_device
self._name = tracker_device.tracker.tracker_name
self.entity_id = f"{ENTITY_ID_FORMAT.format('eco_mode')}.{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self.entity_id = f"{ENTITY_ID_FORMAT.format('eco_mode')}_{tracker_device.tracker.tracker_id}"# pylint: disable=C0301
self._hass = hass
@property

View File

@@ -4,5 +4,5 @@
"render_readme": true,
"domains": ["devices_tracker", "sensor"],
"country": ["FR"],
"homeassistant": "2023.2.0"
"homeassistant": "2024.11.0"
}