Skip to content

Commit

Permalink
Replaced BinarySensorDevice with BinarySensorEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed Jun 5, 2020
1 parent f777198 commit fcc734d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/burze_dzis_net/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from homeassistant.const import CONF_NAME, CONF_RADIUS, CONF_API_KEY, ATTR_ATTRIBUTION, CONF_LATITUDE, CONF_LONGITUDE, \
CONF_SCAN_INTERVAL
import homeassistant.helpers.config_validation as cv
from homeassistant.components.binary_sensor import BinarySensorDevice
try:
from homeassistant.components.binary_sensor import BinarySensorEntity
except ImportError:
from homeassistant.components.binary_sensor import BinarySensorDevice as BinarySensorEntity
from homeassistant.helpers.entity import async_generate_entity_id

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -109,7 +112,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(sensors, True)


class BurzeDzisNetSensor(BinarySensorDevice):
class BurzeDzisNetSensor(BinarySensorEntity):

def __init__(self, entity_id, name, updater):
self.entity_id = entity_id
Expand Down

0 comments on commit fcc734d

Please sign in to comment.