Skip to content

Commit

Permalink
Clear deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
widewing committed Apr 14, 2024
1 parent 290b286 commit 42653c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions custom_components/toyota_na/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.sensor import SensorStateClass
from homeassistant.const import LENGTH_MILES, PERCENTAGE, PRESSURE_PSI
from homeassistant.const import PERCENTAGE, UnitOfPressure

from toyota_na.vehicle.base_vehicle import RemoteRequestCommand

Expand Down Expand Up @@ -161,35 +161,35 @@
"icon": "mdi:car-tire-alert",
"feature": VehicleFeatures.FrontDriverTire,
"name": "Front Driver Tire",
"unit": PRESSURE_PSI,
"unit": UnitOfPressure.PSI,
},
{
"state_class": SensorStateClass.MEASUREMENT,
"icon": "mdi:car-tire-alert",
"feature": VehicleFeatures.FrontPassengerTire,
"name": "Front Passenger Tire",
"unit": PRESSURE_PSI,
"unit": UnitOfPressure.PSI,
},
{
"state_class": SensorStateClass.MEASUREMENT,
"icon": "mdi:car-tire-alert",
"feature": VehicleFeatures.RearDriverTire,
"name": "Rear Driver Tire",
"unit": PRESSURE_PSI,
"unit": UnitOfPressure.PSI,
},
{
"state_class": SensorStateClass.MEASUREMENT,
"icon": "mdi:car-tire-alert",
"feature": VehicleFeatures.RearPassengerTire,
"name": "Rear Passenger Tire",
"unit": PRESSURE_PSI,
"unit": UnitOfPressure.PSI,
},
{
"state_class": SensorStateClass.MEASUREMENT,
"icon": "mdi:car-tire-alert",
"feature": VehicleFeatures.SpareTirePressure,
"name": "Spare Tire Pressure",
"unit": PRESSURE_PSI,
"unit": UnitOfPressure.PSI,
},
{
"state_class": SensorStateClass.MEASUREMENT,
Expand Down
4 changes: 2 additions & 2 deletions custom_components/toyota_na/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from toyota_na.vehicle.base_vehicle import ToyotaVehicle, VehicleFeatures
from toyota_na.vehicle.entity_types.ToyotaLocation import ToyotaLocation

from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker import SourceType
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -81,7 +81,7 @@ def longitude(self):

@property
def source_type(self):
return SOURCE_TYPE_GPS
return SourceType.GPS

@property
def available(self):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/toyota_na/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"codeowners": ["@vanstinator, @widewing"],
"requirements": ["toyota-na==2.1.1"],
"issue_tracker": "https://github.com/widewing/ha-toyota-na/issues",
"version": "2.2.0",
"version": "2.2.1",
"iot_class": "cloud_polling"
}
6 changes: 3 additions & 3 deletions custom_components/toyota_na/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from homeassistant.components.sensor import SensorStateClass
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import LENGTH_KILOMETERS, LENGTH_MILES
from homeassistant.const import UnitOfLength
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
Expand Down Expand Up @@ -89,8 +89,8 @@ def unit_of_measurement(self):
if self._unit_of_measurement == "MI_OR_KM":
_unit = cast(ToyotaNumeric, self.feature(self._vehicle_feature)).unit
if _unit == "mi":
return LENGTH_MILES
return UnitOfLength.MILES
elif _unit == "km":
return LENGTH_KILOMETERS
return UnitOfLength.KILOMETERS

return self._unit_of_measurement

0 comments on commit 42653c9

Please sign in to comment.