mirror of
https://github.com/elisspace/core.git
synced 2026-10-01 23:10:05 +00:00
Security fix & lock for HomeMatic (#11980)
* HomeMatic KeyMatic device become a real lock component * Adds supported features to lock component. Locks may are capable to open the door latch. If component is support it, the SUPPORT_OPENING bitmask can be supplied in the supported_features property. * hound improvements. * Travis improvements. * Improvements from review process * Simplifies is_locked method * Adds an openable lock in the lock demo component * removes blank line * Adds test for openable demo lock and lint and reviewer improvements. * adds new line... * Comment end with a period. * Additional blank line. * Mock service based testing, lint fixes * Update description
This commit is contained in:
committed by
Paulus Schoutsen
parent
8a204fd15b
commit
0d48a8eec6
@@ -4,11 +4,10 @@ import unittest
|
||||
from homeassistant.setup import setup_component
|
||||
from homeassistant.components import lock
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
|
||||
from tests.common import get_test_home_assistant, mock_service
|
||||
FRONT = 'lock.front_door'
|
||||
KITCHEN = 'lock.kitchen_door'
|
||||
OPENABLE_LOCK = 'lock.openable_lock'
|
||||
|
||||
|
||||
class TestLockDemo(unittest.TestCase):
|
||||
@@ -48,3 +47,10 @@ class TestLockDemo(unittest.TestCase):
|
||||
self.hass.block_till_done()
|
||||
|
||||
self.assertFalse(lock.is_locked(self.hass, FRONT))
|
||||
|
||||
def test_opening(self):
|
||||
"""Test the opening of a lock."""
|
||||
calls = mock_service(self.hass, lock.DOMAIN, lock.SERVICE_OPEN)
|
||||
lock.open_lock(self.hass, OPENABLE_LOCK)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(1, len(calls))
|
||||
|
||||
Reference in New Issue
Block a user