From 5cea8fda9f6c3800274bf67121303395de542f24 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 2 Feb 2016 23:55:44 +0100 Subject: [PATCH] Update link to docs and add docstrings --- homeassistant/components/weblink.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/weblink.py b/homeassistant/components/weblink.py index 9a75d9683c1..96c4f0f4dd1 100644 --- a/homeassistant/components/weblink.py +++ b/homeassistant/components/weblink.py @@ -2,21 +2,17 @@ """ homeassistant.components.weblink ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Adds links to external webpage +Adds links to external webpages. For more details about this component, please refer to the documentation at -https://home-assistant.io/components/webpage/ +https://home-assistant.io/components/weblink/ """ - -# The domain of your component. Should be equal to the name of your component import logging from homeassistant.helpers.entity import Entity from homeassistant.util import slugify DOMAIN = "weblink" - -# List of component names (string) your component depends upon DEPENDENCIES = [] ATTR_NAME = 'name' @@ -41,15 +37,13 @@ def setup(hass, config): Link(hass, link.get(ATTR_NAME), link.get(ATTR_URL), link.get(ATTR_ICON)) - # return boolean to indicate that initialization was successful return True class Link(Entity): - """ Represent a link """ + """ Represent a link. """ def __init__(self, hass, name, url, icon): - """ Represents a link. """ self.hass = hass self._name = name self._url = url @@ -59,12 +53,15 @@ class Link(Entity): @property def icon(self): + """ Icon to use in the frontend, if any. """ return self._icon @property def name(self): + """ Returns the name of the URL. """ return self._name @property def state(self): + """ Returns the URL. """ return self._url