diff --git a/homeassistant/components/meteoalarm/binary_sensor.py b/homeassistant/components/meteoalarm/binary_sensor.py index 8af43d3b087..e1ffbe1d9ad 100644 --- a/homeassistant/components/meteoalarm/binary_sensor.py +++ b/homeassistant/components/meteoalarm/binary_sensor.py @@ -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):