Reorg device automation (#26880)

* async_trigger -> async_attach_trigger

* Reorg device automations

* Update docstrings

* Fix types

* Fix extending schemas
This commit is contained in:
Paulus Schoutsen 2019-09-24 14:57:05 -07:00 committed by GitHub
parent b52cfd3409
commit 6fdff9ffab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 2014 additions and 1771 deletions

View file

@ -1,25 +0,0 @@
"""The tests for the Binary sensor component."""
import unittest
from unittest import mock
from homeassistant.components import binary_sensor
from homeassistant.const import STATE_ON, STATE_OFF
class TestBinarySensor(unittest.TestCase):
"""Test the binary_sensor base class."""
def test_state(self):
"""Test binary sensor state."""
sensor = binary_sensor.BinarySensorDevice()
assert STATE_OFF == sensor.state
with mock.patch(
"homeassistant.components.binary_sensor." "BinarySensorDevice.is_on",
new=False,
):
assert STATE_OFF == binary_sensor.BinarySensorDevice().state
with mock.patch(
"homeassistant.components.binary_sensor." "BinarySensorDevice.is_on",
new=True,
):
assert STATE_ON == binary_sensor.BinarySensorDevice().state