Skip to content

Commit

Permalink
Add device class (home-assistant#123059)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabiann2205 authored Aug 2, 2024
1 parent b2d5f9c commit 7670ad0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion homeassistant/components/google_travel_time/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
from googlemaps import Client
from googlemaps.distance_matrix import distance_matrix

from homeassistant.components.sensor import SensorEntity
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
Expand Down Expand Up @@ -72,6 +76,8 @@ class GoogleTravelTimeSensor(SensorEntity):

_attr_attribution = ATTRIBUTION
_attr_native_unit_of_measurement = UnitOfTime.MINUTES
_attr_device_class = SensorDeviceClass.DURATION
_attr_state_class = SensorStateClass.MEASUREMENT

def __init__(self, config_entry, name, api_key, origin, destination, client):
"""Initialize the sensor."""
Expand Down

0 comments on commit 7670ad0

Please sign in to comment.