Add starline binary sensors (#105724)

* Additional attributes for starline

* Handsfree binary sensor

* Sensors

* Review
This commit is contained in:
Nikolay Vasilchuk 2023-12-22 15:22:44 +03:00 committed by GitHub
parent 102c7f1959
commit 243ee2247b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View file

@ -7,6 +7,7 @@ from homeassistant.components.binary_sensor import (
BinarySensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -18,7 +19,7 @@ BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
BinarySensorEntityDescription(
key="hbrake",
translation_key="hand_brake",
device_class=BinarySensorDeviceClass.POWER,
icon="mdi:car-brake-parking",
),
BinarySensorEntityDescription(
key="hood",
@ -40,6 +41,24 @@ BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
translation_key="doors",
device_class=BinarySensorDeviceClass.LOCK,
),
BinarySensorEntityDescription(
key="hfree",
translation_key="handsfree",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:hand-back-right",
),
BinarySensorEntityDescription(
key="neutral",
translation_key="neutral",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:car-shift-pattern",
),
BinarySensorEntityDescription(
key="arm_moving_pb",
translation_key="moving_ban",
entity_category=EntityCategory.DIAGNOSTIC,
icon="mdi:car-off",
),
)

View file

@ -9,6 +9,7 @@ from homeassistant.components.sensor import (
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
PERCENTAGE,
EntityCategory,
UnitOfElectricPotential,
UnitOfLength,
UnitOfTemperature,
@ -60,6 +61,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key="errors",
translation_key="errors",
icon="mdi:alert-octagon",
entity_category=EntityCategory.DIAGNOSTIC,
),
SensorEntityDescription(
key="mileage",

View file

@ -54,6 +54,15 @@
},
"doors": {
"name": "Doors"
},
"handsfree": {
"name": "Handsfree"
},
"neutral": {
"name": "Programmable neutral"
},
"moving_ban": {
"name": "Moving ban"
}
},
"device_tracker": {