Skip to content

Commit c3185da

Browse files
committed
Cannot import from homeassistant
1 parent 7ad094c commit c3185da

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

plugwise/constants.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
""" Plugwise Stick and Smile constants."""
22

3-
from homeassistant.const import (
4-
ATTR_NAME,
5-
ATTR_UNIT_OF_MEASUREMENT,
6-
DEGREE,
7-
ENERGY_KILO_WATT_HOUR,
8-
ENERGY_WATT_HOUR,
9-
PERCENTAGE,
10-
POWER_WATT,
11-
PRESSURE_BAR,
12-
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
13-
TEMP_CELSIUS,
14-
TIME_MILLISECONDS,
15-
VOLUME_CUBIC_METERS,
16-
)
3+
# Copied homeassistant.consts:
4+
ATTR_NAME = "name"
5+
ATTR_UNIT_OF_MEASUREMENT = "unit_of_measurement"
6+
DEGREE = "°"
7+
ENERGY_KILO_WATT_HOUR = f"k{ENERGY_WATT_HOUR}"
8+
ENERGY_WATT_HOUR = f"{POWER_WATT}h"
9+
PERCENTAGE = "%"
10+
POWER_WATT = "W"
11+
PRESSURE_BAR = "bar"
12+
SIGNAL_STRENGTH_DECIBELS_MILLIWATT = "dBm"
13+
TEMP_CELSIUS = f"{DEGREE}C"
14+
TIME_MILLISECONDS = "ms"
15+
VOLUME_CUBIC_METERS = "m³"
1716

1817
### Stick constants ###
1918

plugwise/smile.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,17 @@
1515
# Version detection
1616
import semver
1717

18-
from homeassistant.const import (
18+
from plugwise.constants import (
1919
ATTR_NAME,
2020
ATTR_UNIT_OF_MEASUREMENT,
21-
ENERGY_KILO_WATT_HOUR,
22-
ENERGY_WATT_HOUR,
23-
)
24-
from plugwise.constants import (
2521
APPLIANCES,
2622
DEFAULT_PORT,
2723
DEFAULT_TIMEOUT,
2824
DEFAULT_USERNAME,
2925
DEVICE_MEASUREMENTS,
3026
DOMAIN_OBJECTS,
27+
ENERGY_KILO_WATT_HOUR,
28+
ENERGY_WATT_HOUR,
3129
HOME_MEASUREMENTS,
3230
LOCATIONS,
3331
NOTIFICATIONS,

0 commit comments

Comments
 (0)