mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Add GPS satellites count to Starline sensor (#105740)
* GPS Satellites count Starline sensor * Update homeassistant/components/starline/sensor.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Update homeassistant/components/starline/strings.json Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Capitalise units * Revert capitalisation --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
This commit is contained in:
parent
a4e9a053c7
commit
c2cfc8ab46
@ -70,6 +70,12 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
device_class=SensorDeviceClass.DISTANCE,
|
device_class=SensorDeviceClass.DISTANCE,
|
||||||
icon="mdi:counter",
|
icon="mdi:counter",
|
||||||
),
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key="gps_count",
|
||||||
|
translation_key="gps_count",
|
||||||
|
icon="mdi:satellite-variant",
|
||||||
|
native_unit_of_measurement="satellites",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -132,6 +138,8 @@ class StarlineSensor(StarlineEntity, SensorEntity):
|
|||||||
return self._device.errors.get("val")
|
return self._device.errors.get("val")
|
||||||
if self._key == "mileage" and self._device.mileage:
|
if self._key == "mileage" and self._device.mileage:
|
||||||
return self._device.mileage.get("val")
|
return self._device.mileage.get("val")
|
||||||
|
if self._key == "gps_count" and self._device.position:
|
||||||
|
return self._device.position["sat_qty"]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -99,6 +99,9 @@
|
|||||||
},
|
},
|
||||||
"mileage": {
|
"mileage": {
|
||||||
"name": "Mileage"
|
"name": "Mileage"
|
||||||
|
},
|
||||||
|
"gps_count": {
|
||||||
|
"name": "GPS satellites"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user