mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Remove state property from alarmdecoder binary sensor (#7370)
This commit is contained in:
parent
64a7be66b1
commit
064b2cdb9f
@ -11,7 +11,6 @@ from homeassistant.core import callback
|
|||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
|
|
||||||
from homeassistant.const import (STATE_ON, STATE_OFF, STATE_OPEN, STATE_CLOSED)
|
|
||||||
from homeassistant.components.alarmdecoder import (ZONE_SCHEMA,
|
from homeassistant.components.alarmdecoder import (ZONE_SCHEMA,
|
||||||
CONF_ZONES,
|
CONF_ZONES,
|
||||||
CONF_ZONE_NAME,
|
CONF_ZONE_NAME,
|
||||||
@ -69,14 +68,6 @@ class AlarmDecoderBinarySensor(BinarySensorDevice):
|
|||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass, SIGNAL_ZONE_RESTORE, self._restore_callback)
|
self.hass, SIGNAL_ZONE_RESTORE, self._restore_callback)
|
||||||
|
|
||||||
@property
|
|
||||||
def state(self):
|
|
||||||
"""Return the state of the binary sensor."""
|
|
||||||
if self._type == 'opening':
|
|
||||||
return STATE_OPEN if self.is_on else STATE_CLOSED
|
|
||||||
|
|
||||||
return STATE_ON if self.is_on else STATE_OFF
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the entity."""
|
"""Return the name of the entity."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user