mirror of
https://github.com/skalavala/mysmarthome.git
synced 2025-08-21 12:42:47 +00:00
updates to 0.115.5
This commit is contained in:
@@ -3,7 +3,7 @@ import logging
|
||||
|
||||
import requests
|
||||
|
||||
from homeassistant.const import TEMP_CELSIUS, UNIT_PERCENTAGE
|
||||
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
from . import DOMAIN as COMPONENT_DOMAIN, SENSOR_TYPES
|
||||
@@ -32,7 +32,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"If you do not want to have your printer on <br />"
|
||||
" at all times, and you would like to monitor <br /> "
|
||||
"temperatures, please add <br />"
|
||||
"bed and/or number_of_tools to your configuration <br />"
|
||||
"bed and/or number_of_tools to your configuration <br />"
|
||||
"and restart.",
|
||||
title=NOTIFICATION_TITLE,
|
||||
notification_id=NOTIFICATION_ID,
|
||||
@@ -91,7 +91,7 @@ class OctoPrintSensor(Entity):
|
||||
if tool is None:
|
||||
self._name = f"{sensor_name} {condition}"
|
||||
else:
|
||||
self._name = "{} {} {} {}".format(sensor_name, condition, tool, "temp")
|
||||
self._name = f"{sensor_name} {condition} {tool} temp"
|
||||
self.sensor_type = sensor_type
|
||||
self.api = api
|
||||
self._state = None
|
||||
@@ -111,7 +111,7 @@ class OctoPrintSensor(Entity):
|
||||
def state(self):
|
||||
"""Return the state of the sensor."""
|
||||
sensor_unit = self.unit_of_measurement
|
||||
if sensor_unit in (TEMP_CELSIUS, UNIT_PERCENTAGE):
|
||||
if sensor_unit in (TEMP_CELSIUS, PERCENTAGE):
|
||||
# API sometimes returns null and not 0
|
||||
if self._state is None:
|
||||
self._state = 0
|
||||
|
Reference in New Issue
Block a user