Skip to content

Commit 86cca00

Browse files
Merge pull request #7 from gerard33/patch-2
Add unique_id
2 parents 9efeeea + 1b71197 commit 86cca00

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

custom_components/omnik_inverter/sensor.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import re
2323
import pickle
2424

25-
VERSION = '1.0.0'
25+
VERSION = '1.0.1'
2626

2727
BASE_URL = 'http://{0}/js/status.js'
2828
BASE_CACHE_NAME = '.{0}.pickle'
@@ -106,6 +106,12 @@ def __init__(self, data, sensor_type):
106106
self._icon = SENSOR_TYPES[self.type][2]
107107
self._state = None
108108
self.update()
109+
self._unique_id = f"{self.data.result[0]}-{self._name}"
110+
111+
@property
112+
def unique_id(self):
113+
"""Return the unique ID of the sensor."""
114+
return self._unique_id
109115

110116
@property
111117
def name(self):

0 commit comments

Comments
 (0)