Skip to content

Commit 16231ec

Browse files
committed
Upped version number, fixed ruff errors
1 parent 767e7ed commit 16231ec

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

custom_components/optispark/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
NAME = "Optispark"
77
DOMAIN = "optispark"
8-
VERSION = "0.0.7"
8+
VERSION = "0.0.8"
99
ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/"
1010

1111
LAMBDA_TEMP = 'temps'

custom_components/optispark/coordinator.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__(
7373
self._user_hash)
7474

7575
def convert_sensor_from_farenheit(self, entity, temp):
76-
"""Ensure that the sensor returns values in Celcius
76+
"""Ensure that the sensor returns values in Celcius.
7777
7878
Only works with sensor entities
7979
If the sensor uses Farenheit then we'll need to convert Farenheit to Celcius
@@ -85,10 +85,10 @@ def convert_sensor_from_farenheit(self, entity, temp):
8585
# Convert temperature from Celcius to Farenheit
8686
return (temp-32) * 5/9
8787
else:
88-
raise ValueError(f'Heat pump uses unkown units ({heat_pump_unit})')
88+
raise ValueError(f'Heat pump uses unkown units ({sensor_unit})')
8989

9090
def convert_climate_from_farenheit(self, entity, temp):
91-
"""Ensure that the heat pump returns values in Celcius
91+
"""Ensure that the heat pump returns values in Celcius.
9292
9393
Only works with climate entity
9494
If the heat_pump uses Farenheit then we'll need to convert Farenheit to Celcius
@@ -103,10 +103,11 @@ def convert_climate_from_farenheit(self, entity, temp):
103103
raise ValueError(f'Heat pump uses unkown units ({heat_pump_unit})')
104104

105105
def convert_climate_from_celcius(self, entity, temp):
106-
"""Ensure that the heat pump is given a temperature in the correct units
106+
"""Ensure that the heat pump is given a temperature in the correct units.
107107
108108
Only works with climate entities.
109-
If the heat_pump uses Farenheit then we'll need to convert Celcius to Farenheit"""
109+
If the heat_pump uses Farenheit then we'll need to convert Celcius to Farenheit
110+
"""
110111
heat_pump_unit = entity.temperature_unit
111112
if heat_pump_unit == homeassistant.const.TEMP_CELSIUS:
112113
return temp

custom_components/optispark/history.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import json
2121
from .const import LOGGER
2222
from . import const
23-
from . import get_entity
2423

2524

2625
class OptisparkGetHistoryError(Exception):
@@ -67,7 +66,7 @@ def get_user_info(hass, heat_pump_entity_id):
6766
def climate_history(hass, climate_entity_id, state_changes):
6867
"""Climate history.
6968
70-
Home assistant logs the temperature states in whatever unit is set by the user (not the heat
69+
Home assistant logs the temperature states in whatever unit is set by the user (not the heat
7170
pump entity). We only need to convert the temperature to °C if the user is using hh in °F mode.
7271
7372
If the user toggles the hh temperature units, the past logs will be messed up. The units will be

custom_components/optispark/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"documentation": "https://github.com/Big-Tree/HomeAssistant-OptiSpark",
1111
"iot_class": "cloud_polling",
1212
"issue_tracker": "https://github.com/Big-Tree/HomeAssistant-OptiSpark/issues",
13-
"version": "0.0.7"
13+
"version": "0.0.8"
1414
}

0 commit comments

Comments
 (0)