Rename CONF_ATTRIBUTION to ATTRIBUTION (#21069)

* Rename CONF_ATTRIBUTION to ATTRIBUTION

* Update homeassistant/components/sensor/irish_rail_transport.py

Co-Authored-By: fabaff <mail@fabian-affolter.ch>
This commit is contained in:
Fabian Affolter authored and GitHub committed 2019-02-14 22:09:22 +01:00
1 parent 03ec3ac16e
commit cdc4dc3f11
66 files changed
+232 -239

No files matched your search

+4 -12
View File
@@ -1,16 +1,11 @@
"""
Support for Melnor RainCloud sprinkler water timer.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.raincloud/
"""
"""Support for Melnor RainCloud sprinkler water timer."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.raincloud import (
ALLOWED_WATERING_TIME, CONF_ATTRIBUTION, CONF_WATERING_TIME,
ALLOWED_WATERING_TIME, ATTRIBUTION, CONF_WATERING_TIME,
DATA_RAINCLOUD, DEFAULT_WATERING_TIME, RainCloudEntity, SWITCHES)
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.const import (
@@ -38,12 +33,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
# create a sensor for each zone managed by faucet
for zone in raincloud.controller.faucet.zones:
sensors.append(
RainCloudSwitch(default_watering_timer,
zone,
sensor_type))
RainCloudSwitch(default_watering_timer, zone, sensor_type))
add_entities(sensors, True)
return True
class RainCloudSwitch(RainCloudEntity, SwitchDevice):
@@ -87,7 +79,7 @@ class RainCloudSwitch(RainCloudEntity, SwitchDevice):
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_ATTRIBUTION: ATTRIBUTION,
'default_manual_timer': self._default_watering_timer,
'identifier': self.data.serial
}