Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark sensors as diagnostic #86

Merged
merged 4 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion custom_components/toyota/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Binary sensor platform for Toyota integration"""

from homeassistant.components.binary_sensor import (
DEVICE_CLASS_DOOR,
DEVICE_CLASS_LIGHT,
DEVICE_CLASS_PROBLEM,
DEVICE_CLASS_WINDOW,
BinarySensorEntity,
)
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC

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

_attr_device_class = DEVICE_CLASS_DOOR
_attr_icon = ICON_CAR_DOOR
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC

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

_attr_device_class = DEVICE_CLASS_DOOR
_attr_icon = ICON_CAR_DOOR
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC

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

_attr_device_class = DEVICE_CLASS_DOOR
_attr_icon = ICON_CAR_DOOR_LOCK
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC

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

_attr_icon = ICON_KEY
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC

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

_attr_device_class = DEVICE_CLASS_LIGHT
_attr_icon = ICON_CAR_LIGHTS
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC

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

_attr_device_class = DEVICE_CLASS_WINDOW
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC

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

from homeassistant.const import (
DEVICE_CLASS_TEMPERATURE,
ENTITY_CATEGORY_DIAGNOSTIC,
PERCENTAGE,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
Expand Down Expand Up @@ -88,6 +89,7 @@ class ToyotaCarSensor(ToyotaBaseEntity):
"""Class for car details and numberplate sensor."""

_attr_icon = ICON_CAR
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC

@property
def extra_state_attributes(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"

[tool.poetry.dependencies]
python = "^3.8"
homeassistant = "^2021.3.3"
homeassistant = ">=2021.11"
mytoyota = "0.7.5"
arrow = "^1.1.1"

Expand Down