Skip to content

Commit

Permalink
9 (#27)
Browse files Browse the repository at this point in the history
* Fix deprecation warnings (#24)

* Fix deprecation warning for binary sensor

* Fix deprecation warning for switch

* Fix camera (#25)

Changed camera image method to async.

* Fix translations (#26)

Rename translations directory from .translations to translations.

Closes #21. Closes #23.
  • Loading branch information
marthoc authored Aug 13, 2020
1 parent 3fdff4b commit a7bcbc1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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
File renamed without changes.

0 comments on commit a7bcbc1

Please sign in to comment.