From 7724cb9eb47e9c82af1951f8bdf2da58958b8173 Mon Sep 17 00:00:00 2001 From: Jeff Wilson Date: Wed, 14 Sep 2016 02:10:49 -0400 Subject: [PATCH] Fix octoprint sensor (#3385) * Fix non-temperature sensors for octoprint * Fix double space in octoprint temperature names * Fix tox linting errors --- homeassistant/components/sensor/octoprint.py | 21 +++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/sensor/octoprint.py b/homeassistant/components/sensor/octoprint.py index 3b4635c829a..3b55200e647 100644 --- a/homeassistant/components/sensor/octoprint.py +++ b/homeassistant/components/sensor/octoprint.py @@ -60,17 +60,14 @@ def setup_platform(hass, config, add_devices, discovery_info=None): tool) devices.append(new_sensor) else: - _LOGGER.error("Unknown OctoPrint sensor type: %s", octo_type) - - new_sensor = OctoPrintSensor(octoprint.OCTOPRINT, - octo_type, - SENSOR_TYPES[octo_type][2], - name, - SENSOR_TYPES[octo_type][3], - SENSOR_TYPES[octo_type][0], - SENSOR_TYPES[octo_type][1]) - devices.append(new_sensor) - + new_sensor = OctoPrintSensor(octoprint.OCTOPRINT, + octo_type, + SENSOR_TYPES[octo_type][2], + name, + SENSOR_TYPES[octo_type][3], + SENSOR_TYPES[octo_type][0], + SENSOR_TYPES[octo_type][1]) + devices.append(new_sensor) add_devices(devices) @@ -87,7 +84,7 @@ class OctoPrintSensor(Entity): self._name = '{} {}'.format(sensor_name, condition) else: self._name = '{} {} {} {}'.format( - sensor_name, condition, tool, ' temp') + sensor_name, condition, tool, 'temp') self.sensor_type = sensor_type self.api = api self._state = None