Guard for callbacks in service helper (#31339)

This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2020-01-31 09:24:02 +00:00
1 parent a53c3d10fe
commit c6baf026a7
2 files changed
+10 -8

No files matched your search

+4 -6
View File
@@ -400,19 +400,17 @@ class Camera(Entity):
"""Turn off camera."""
raise NotImplementedError()
@callback
def async_turn_off(self):
async def async_turn_off(self):
"""Turn off camera."""
return self.hass.async_add_job(self.turn_off)
await self.hass.async_add_job(self.turn_off)
def turn_on(self):
"""Turn off camera."""
raise NotImplementedError()
@callback
def async_turn_on(self):
async def async_turn_on(self):
"""Turn off camera."""
return self.hass.async_add_job(self.turn_on)
await self.hass.async_add_job(self.turn_on)
def enable_motion_detection(self):
"""Enable motion detection in the camera."""