From 98bedf1bd629da4078832c7fdc59f01b76438ec3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 7 May 2016 03:03:18 +0200 Subject: [PATCH] Update links to docs and doc strings (#1994) --- homeassistant/components/binary_sensor/octoprint.py | 12 +++++------- homeassistant/components/octoprint.py | 9 ++++----- homeassistant/components/sensor/octoprint.py | 12 +++++------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/homeassistant/components/binary_sensor/octoprint.py b/homeassistant/components/binary_sensor/octoprint.py index 803416ce66c..25c922ca20c 100644 --- a/homeassistant/components/binary_sensor/octoprint.py +++ b/homeassistant/components/binary_sensor/octoprint.py @@ -1,11 +1,9 @@ """ Support for monitoring OctoPrint binary sensors. -Uses OctoPrint REST JSON API to query for monitored variables. -For more details about this component, please refer to the documentation at -http://docs.octoprint.org/en/master/api/ +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/binary_sensor.octoprint/ """ - import logging import requests @@ -51,7 +49,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): # pylint: disable=too-many-instance-attributes class OctoPrintBinarySensor(BinarySensorDevice): - """Represents an OctoPrint binary sensor.""" + """Representation an OctoPrint binary sensor.""" # pylint: disable=too-many-arguments def __init__(self, api, condition, sensor_type, sensor_name, @@ -71,7 +69,7 @@ class OctoPrintBinarySensor(BinarySensorDevice): self.api_tool = tool # Set initial state self.update() - _LOGGER.debug("created OctoPrint binary sensor %r", self) + _LOGGER.debug("Created OctoPrint binary sensor %r", self) @property def name(self): @@ -108,4 +106,4 @@ class OctoPrintBinarySensor(BinarySensorDevice): return if self._state is None: - _LOGGER.warning("unable to locate value for %s", self.sensor_type) + _LOGGER.warning("Unable to locate value for %s", self.sensor_type) diff --git a/homeassistant/components/octoprint.py b/homeassistant/components/octoprint.py index 9d7f015a2f4..76db48b5a07 100644 --- a/homeassistant/components/octoprint.py +++ b/homeassistant/components/octoprint.py @@ -1,10 +1,9 @@ """ Support for monitoring OctoPrint 3D printers. -Uses OctoPrint REST JSON API to query for monitored variables. -http://docs.octoprint.org/en/master/api/ +For more details about this component, please refer to the documentation at +https://home-assistant.io/components/octoprint/ """ - import logging import time @@ -52,7 +51,7 @@ def setup(hass, config): class OctoPrintAPI(object): - """Simple json wrapper for OctoPrint's api.""" + """Simple JSON wrapper for OctoPrint's API.""" def __init__(self, api_url, key): """Initialize OctoPrint API and set headers needed later.""" @@ -109,7 +108,7 @@ class OctoPrintAPI(object): # pylint: disable=unused-variable def get_value_from_json(json_dict, sensor_type, group, tool): - """Return the value for sensor_type from the provided json.""" + """Return the value for sensor_type from the JSON.""" if group in json_dict: if sensor_type in json_dict[group]: if sensor_type == "target" and json_dict[sensor_type] is None: diff --git a/homeassistant/components/sensor/octoprint.py b/homeassistant/components/sensor/octoprint.py index 3e47c4d51fe..bb4e6973df8 100644 --- a/homeassistant/components/sensor/octoprint.py +++ b/homeassistant/components/sensor/octoprint.py @@ -1,11 +1,9 @@ """ Support for monitoring OctoPrint sensors. -Uses OctoPrint REST JSON API to query for monitored variables. -For more details about this component, please refer to the documentation at -http://docs.octoprint.org/en/master/api/ +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/sensor.octoprint/ """ - import logging import requests @@ -65,7 +63,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): # pylint: disable=too-many-instance-attributes class OctoPrintSensor(Entity): - """Represents an OctoPrint sensor.""" + """Representation of an OctoPrint sensor.""" # pylint: disable=too-many-arguments def __init__(self, api, condition, sensor_type, sensor_name, @@ -85,7 +83,7 @@ class OctoPrintSensor(Entity): self.api_tool = tool # Set initial state self.update() - _LOGGER.debug("created OctoPrint sensor %r", self) + _LOGGER.debug("Created OctoPrint sensor %r", self) @property def name(self): @@ -114,5 +112,5 @@ class OctoPrintSensor(Entity): return if self._state is None: - _LOGGER.warning("unable to locate value for %s", self.sensor_type) + _LOGGER.warning("Unable to locate value for %s", self.sensor_type) return