Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged

9 #27

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions custom_components/kuna/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import logging

from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import BinarySensorEntity
from .const import DOMAIN, MANUFACTURER


Expand All @@ -31,7 +31,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(devices, True)


class KunaBinarySensor(BinarySensorDevice):
class KunaBinarySensor(BinarySensorEntity):
def __init__(self, kuna, camera):
self._account = kuna
self._camera = camera
Expand Down
2 changes: 1 addition & 1 deletion custom_components/kuna/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async def async_added_to_hass(self):
def _ready_for_snapshot(self, now):
return self._next_snapshot_at is None or now > self._next_snapshot_at

async def camera_image(self):
async def async_camera_image(self):
"""Get and return an image from the camera, only once every stream_interval seconds."""
stream_interval = timedelta(seconds=self._config[CONF_STREAM_INTERVAL])
now = utcnow()
Expand Down
4 changes: 2 additions & 2 deletions custom_components/kuna/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import logging

from homeassistant.components.switch import SwitchDevice
from homeassistant.components.switch import SwitchEntity
from .const import DOMAIN, MANUFACTURER


Expand All @@ -31,7 +31,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(devices, True)


class KunaSwitch(SwitchDevice):
class KunaSwitch(SwitchEntity):
def __init__(self, kuna, camera):
self._account = kuna
self._camera = camera
Expand Down