Compare commits

...

11 Commits

Author SHA1 Message Date
7be10411f5 Bump version to 1.1.2 2026-02-05 21:45:59 +01:00
97b54c9de8 Merge pull request #16 from ptimatth/15-update-ha-202620---missing-all-entities
feat: Update entity_id format and add GeoRide model support
2026-02-05 21:31:21 +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
10 changed files with 41 additions and 40 deletions

View File

@@ -102,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

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"
elif 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

@@ -11,5 +11,5 @@
],
"dependencies": [],
"codeowners": ["ptimatth"],
"version": "1.1.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"
}