Add "Refactor zwave discovery to entity schema" (#6565)

* Revert "Revert "Refactor zwave discovery to entity schema (#6445)" (#6564)"

This reverts commit 58826b264a.

* Update zwave tests for enitity schema

* Fix merge error

* Switch dict_id to id(self)
This commit is contained in:
Paulus Schoutsen authored and Adam Mills committed 2017-03-14 19:55:33 -04:00
1 parent cada74df22
commit 1a7ffdca52
14 files changed
+709 -577

No files matched your search

+17
View File
@@ -73,3 +73,20 @@ class MockValue(MagicMock):
def _get_child_mock(self, **kw):
"""Create child mocks with right MagicMock class."""
return MagicMock(**kw)
class MockEntityValues():
"""Mock Z-Wave entity values."""
def __init__(self, **kwargs):
"""Initialize the mock zwave values."""
self.primary = None
self.wakeup = None
self.battery = None
self.power = None
for name in kwargs:
setattr(self, name, kwargs[name])
def __iter__(self):
"""Allow iteration over all values."""
return iter(self.__dict__.values())