Skip to content

Commit

Permalink
Fix EntityCategory (#105)
Browse files Browse the repository at this point in the history
* Fix EntityCategory

* Update sensor.py

* Update sensor.py

* Update sensor.py
  • Loading branch information
DurgNomis-drol authored Apr 7, 2022
1 parent e1cfdff commit 278b11d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions custom_components/toyota/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC
from homeassistant.helpers.entity import EntityCategory

from .const import (
DATA_COORDINATOR,
Expand Down Expand Up @@ -130,7 +130,7 @@ class ToyotaHoodBinarySensor(ToyotaBaseEntity, BinarySensorEntity):

_attr_device_class = BinarySensorDeviceClass.DOOR
_attr_icon = ICON_CAR_DOOR
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
_attr_entity_category = EntityCategory.DIAGNOSTIC

@property
def extra_state_attributes(self):
Expand All @@ -151,7 +151,7 @@ class ToyotaDoorBinarySensor(ToyotaBaseEntity, BinarySensorEntity):

_attr_device_class = BinarySensorDeviceClass.DOOR
_attr_icon = ICON_CAR_DOOR
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
_attr_entity_category = EntityCategory.DIAGNOSTIC

@property
def extra_state_attributes(self):
Expand Down Expand Up @@ -184,7 +184,7 @@ class ToyotaDoorLockBinarySensor(ToyotaBaseEntity, BinarySensorEntity):

_attr_device_class = BinarySensorDeviceClass.DOOR
_attr_icon = ICON_CAR_DOOR_LOCK
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
_attr_entity_category = EntityCategory.DIAGNOSTIC

@property
def extra_state_attributes(self):
Expand Down Expand Up @@ -216,7 +216,7 @@ class ToyotaKeyBinarySensor(ToyotaBaseEntity, BinarySensorEntity):
"""Class for key in car binary sensor"""

_attr_icon = ICON_KEY
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
_attr_entity_category = EntityCategory.DIAGNOSTIC

@property
def extra_state_attributes(self):
Expand All @@ -236,7 +236,7 @@ class ToyotaLightBinarySensor(ToyotaBaseEntity, BinarySensorEntity):

_attr_device_class = BinarySensorDeviceClass.LIGHT
_attr_icon = ICON_CAR_LIGHTS
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
_attr_entity_category = EntityCategory.DIAGNOSTIC

@property
def extra_state_attributes(self):
Expand Down Expand Up @@ -288,7 +288,7 @@ class ToyotaWindowBinarySensor(ToyotaBaseEntity, BinarySensorEntity):
"""Class for Window sensor"""

_attr_device_class = BinarySensorDeviceClass.WINDOW
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
_attr_entity_category = EntityCategory.DIAGNOSTIC

@property
def extra_state_attributes(self):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/toyota/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import (
ENTITY_CATEGORY_DIAGNOSTIC,
PERCENTAGE,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
TEMP_CELSIUS,
)
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.typing import StateType

from .const import (
Expand Down Expand Up @@ -89,7 +89,7 @@ class ToyotaCarSensor(ToyotaBaseEntity):
"""Class for car details and numberplate sensor."""

_attr_icon = ICON_CAR
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
_attr_entity_category = EntityCategory.DIAGNOSTIC

@property
def extra_state_attributes(self):
Expand Down

0 comments on commit 278b11d

Please sign in to comment.