-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
binary_sensor.py
38 lines (27 loc) · 1.1 KB
/
binary_sensor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""Binary sensor platform for Bermuda BLE Trilateration."""
from __future__ import annotations
from homeassistant.components.binary_sensor import BinarySensorEntity
from .const import BINARY_SENSOR
from .const import BINARY_SENSOR_DEVICE_CLASS
from .const import DEFAULT_NAME
from .entity import BermudaEntity
# from .const import DOMAIN
async def async_setup_entry(hass, entry, async_add_devices):
"""Setup binary_sensor platform."""
# coordinator = hass.data[DOMAIN][entry.entry_id]
# AJG async_add_devices([BermudaBinarySensor(coordinator, entry)])
class BermudaBinarySensor(BermudaEntity, BinarySensorEntity):
"""bermuda binary_sensor class."""
@property
def name(self):
"""Return the name of the binary_sensor."""
return f"{DEFAULT_NAME}_{BINARY_SENSOR}"
@property
def device_class(self):
"""Return the class of this binary_sensor."""
return BINARY_SENSOR_DEVICE_CLASS
@property
def is_on(self):
"""Return true if the binary_sensor is on."""
# return self.coordinator.data.get("title", "") == "foo"
return True