mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Update docstrings
This commit is contained in:
parent
5cea8fda9f
commit
847e92f57a
@ -57,10 +57,12 @@ class AlarmDotCom(alarm.AlarmControlPanel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
|
""" No polling needed. """
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
""" Returns the name of the device. """
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -67,10 +67,12 @@ class SystemMonitorSensor(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
""" Returns the name of the sensor. """
|
||||||
return self._name.rstrip()
|
return self._name.rstrip()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def icon(self):
|
def icon(self):
|
||||||
|
""" Icon to use in the frontend, if any. """
|
||||||
return SENSOR_TYPES[self.type][2]
|
return SENSOR_TYPES[self.type][2]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -80,10 +82,12 @@ class SystemMonitorSensor(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
|
""" Unit of measurement of this entity, if any. """
|
||||||
return self._unit_of_measurement
|
return self._unit_of_measurement
|
||||||
|
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
def update(self):
|
def update(self):
|
||||||
|
""" Get the latest system informations. """
|
||||||
import psutil
|
import psutil
|
||||||
if self.type == 'disk_use_percent':
|
if self.type == 'disk_use_percent':
|
||||||
self._state = psutil.disk_usage(self.argument).percent
|
self._state = psutil.disk_usage(self.argument).percent
|
||||||
|
@ -78,4 +78,5 @@ class TwitchSensor(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def icon(self):
|
def icon(self):
|
||||||
|
""" Icon to use in the frontend, if any. """
|
||||||
return ICON
|
return ICON
|
||||||
|
@ -25,8 +25,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
""" Setup weblink component. """
|
""" Setup weblink component. """
|
||||||
|
|
||||||
# States are in the format DOMAIN.OBJECT_ID
|
|
||||||
|
|
||||||
links = config.get(DOMAIN)
|
links = config.get(DOMAIN)
|
||||||
|
|
||||||
for link in links.get('entities'):
|
for link in links.get('entities'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user