diff --git a/custom_components/pandora_cas/manifest.json b/custom_components/pandora_cas/manifest.json index 62b1e49..dc71477 100644 --- a/custom_components/pandora_cas/manifest.json +++ b/custom_components/pandora_cas/manifest.json @@ -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" } diff --git a/custom_components/pandora_cas/sensor.py b/custom_components/pandora_cas/sensor.py index b814217..32d80db 100644 --- a/custom_components/pandora_cas/sensor.py +++ b/custom_components/pandora_cas/sensor.py @@ -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", @@ -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}") diff --git a/custom_components/pandora_cas/strings.json b/custom_components/pandora_cas/strings.json index d5d612f..9412baa 100644 --- a/custom_components/pandora_cas/strings.json +++ b/custom_components/pandora_cas/strings.json @@ -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", diff --git a/custom_components/pandora_cas/translations/en.json b/custom_components/pandora_cas/translations/en.json index d5d612f..9412baa 100644 --- a/custom_components/pandora_cas/translations/en.json +++ b/custom_components/pandora_cas/translations/en.json @@ -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", diff --git a/custom_components/pandora_cas/translations/ru.json b/custom_components/pandora_cas/translations/ru.json index a820fa9..2593dda 100644 --- a/custom_components/pandora_cas/translations/ru.json +++ b/custom_components/pandora_cas/translations/ru.json @@ -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 в милях",