Skip to content

Commit

Permalink
feat: add missing translations for fuel filter drops
Browse files Browse the repository at this point in the history
feat: add internal_voltage sensor

refactor: bump library version dependency (v0.0.10 -> v0.0.11)
  • Loading branch information
alryaz committed Aug 29, 2024
1 parent 8188c48 commit f1d5b41
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/pandora_cas/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"issue_tracker": "https://github.com/alryaz/hass-pandora-cas/issues",
"requirements": [
"haversine~=2.8.0",
"pandora-cas==0.0.10"
"pandora-cas==0.0.11"
],
"version": "2024.3.11"
}
12 changes: 11 additions & 1 deletion custom_components/pandora_cas/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,16 @@ class PandoraCASSensorEntityDescription(
attribute=CurrentState.voltage,
suggested_display_precision=1,
),
PandoraCASSensorEntityDescription(
key="internal_voltage",
name="Internal voltage",
icon="mdi:fuel-cell",
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
attribute=CurrentState.internal_voltage,
suggested_display_precision=1,
),
PandoraCASSensorEntityDescription(
key="left_front_tire_pressure",
name="Left Front Tire Pressure",
Expand Down Expand Up @@ -507,7 +517,7 @@ def update_native_value(self) -> None:
elif self.entity_description.key == "fuel":
if self._attr_native_value == 0:
fuel_drop_threshold = self._device_config[CONF_FILTER_FUEL_DROPS]
if fuel_drop_threshold > 0 and last_value >= fuel_drop_threshold:
if 0 < fuel_drop_threshold <= last_value:
self._attr_native_value = last_value
self.logger.debug(f"Filtered fuel drop to zero from {last_value}")

Expand Down
1 change: 1 addition & 0 deletions custom_components/pandora_cas/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@
"custom_cursor_type": "Custom cursor type",
"disable_cursor_rotation": "Disable cursor rotation",
"engine_state_by_rpm": "Engine state by RPM",
"filter_fuel_drops": "Fuel tank threshold above which dips to 0 are ignored",
"fuel_is_liters": "Devices with fuel tank measurement in liters",
"ignore_ws_coordinates": "Ignore coordinates updates from WebSockets",
"mileage_can_miles": "CAN mileage is in miles",
Expand Down
1 change: 1 addition & 0 deletions custom_components/pandora_cas/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@
"custom_cursor_type": "Custom cursor type",
"disable_cursor_rotation": "Disable cursor rotation",
"engine_state_by_rpm": "Engine state by RPM",
"filter_fuel_drops": "Fuel tank threshold above which dips to 0 are ignored",
"fuel_is_liters": "Devices with fuel tank measurement in liters",
"ignore_ws_coordinates": "Ignore coordinates updates from WebSockets",
"mileage_can_miles": "CAN mileage is in miles",
Expand Down
1 change: 1 addition & 0 deletions custom_components/pandora_cas/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@
"custom_cursor_type": "Вид курсора трекера",
"disable_cursor_rotation": "Отключить вращение курсора",
"engine_state_by_rpm": "Состояние двигателя по оборотам",
"filter_fuel_drops": "Уровень топлива, выше которого 'провалы' игнорируются",
"fuel_is_liters": "Топливный бак в литрах",
"ignore_ws_coordinates": "Игнорировать обновления координат WS",
"mileage_can_miles": "Пробег по CAN в милях",
Expand Down

0 comments on commit f1d5b41

Please sign in to comment.