Remove icon() (#24280)

This commit is contained in:
Fabian Affolter 2019-06-03 16:31:33 +02:00 committed by Pascal Vizeli
parent 34260ed09f
commit 7fd2e67d11

View File

@ -6,26 +6,22 @@ import voluptuous as vol
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA, BinarySensorDevice)
from homeassistant.const import (
ATTR_ATTRIBUTION, CONF_NAME)
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
ATTRIBUTION = "Information provided by MeteoAlarm"
CONF_COUNTRY = 'country'
CONF_PROVINCE = 'province'
CONF_LANGUAGE = 'language'
CONF_PROVINCE = 'province'
ATTRIBUTION = "Information provided by MeteoAlarm."
DEFAULT_NAME = 'meteoalarm'
DEFAULT_DEVICE_CLASS = 'safety'
ICON = 'mdi:alert'
DEFAULT_NAME = 'meteoalarm'
SCAN_INTERVAL = timedelta(minutes=30)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_COUNTRY): cv.string,
vol.Required(CONF_PROVINCE): cv.string,
@ -46,7 +42,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
try:
api = Meteoalert(country, province, language)
except KeyError():
_LOGGER.error("Wrong country digits, or province name")
_LOGGER.error("Wrong country digits or province name")
return
add_entities([MeteoAlertBinarySensor(api, name)], True)
@ -78,14 +74,9 @@ class MeteoAlertBinarySensor(BinarySensorDevice):
self._attributes[ATTR_ATTRIBUTION] = ATTRIBUTION
return self._attributes
@property
def icon(self):
"""Icon to use in the frontend."""
return ICON
@property
def device_class(self):
"""Return the class of this binary sensor."""
"""Return the device class of this binary sensor."""
return DEFAULT_DEVICE_CLASS
def update(self):