Bug fixes related to entity_ids being lowercase

This commit is contained in:
Paulus Schoutsen committed 2015-02-08 22:18:54 -08:00
1 parent f5084a5f70
commit ce39a6fb18
5 files changed
+81 -52

No files matched your search

+8 -3
View File
@@ -78,8 +78,13 @@ class MockToggleDevice(ToggleDevice):
self._state = STATE_OFF
def last_call(self, method=None):
if method is None:
if not self.calls:
return None
elif method is None:
return self.calls[-1]
else:
return next(call for call in reversed(self.calls)
if call[0] == method)
try:
return next(call for call in reversed(self.calls)
if call[0] == method)
except StopIteration:
return None