diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d834793f..334e4276 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,7 @@ repos: - hooks: - id: black repo: https://github.com/psf/black - rev: 24.1.0 + rev: 24.2.0 - repo: https://github.com/pre-commit/mirrors-prettier hooks: - id: prettier diff --git a/custom_components/tesla_custom/manifest.json b/custom_components/tesla_custom/manifest.json index db681197..dcf0b73d 100644 --- a/custom_components/tesla_custom/manifest.json +++ b/custom_components/tesla_custom/manifest.json @@ -20,6 +20,7 @@ } ], "documentation": "https://github.com/alandtse/tesla/wiki", + "import_executor": true, "iot_class": "cloud_polling", "issue_tracker": "https://github.com/alandtse/tesla/issues", "loggers": ["teslajsonpy"], diff --git a/custom_components/tesla_custom/sensor.py b/custom_components/tesla_custom/sensor.py index 628d33bd..093ad383 100644 --- a/custom_components/tesla_custom/sensor.py +++ b/custom_components/tesla_custom/sensor.py @@ -186,9 +186,9 @@ class TeslaCarChargerPower(TeslaCarEntity, SensorEntity): _attr_native_unit_of_measurement = UnitOfPower.KILO_WATT @property - def native_value(self) -> int: + def native_value(self) -> float: """Return the charger power.""" - return self._car.charger_power + return float(self._car.charger_power) @property def extra_state_attributes(self):