Skip to content

Commit 1594482

Browse files
committed
removed unused 'id' field in dev description
1 parent 4a32a81 commit 1594482

4 files changed

Lines changed: 19 additions & 13 deletions

File tree

custom_components/pijups/interface.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ def configure_device(self, hass: HomeAssistant, entry: ConfigEntry):
114114
raise BlockingIOError
115115

116116
self.piju_device_info = DeviceInfo(
117-
id=entry.unique_id,
118117
identifiers={(DOMAIN, entry.unique_id)},
119118
name=DEFAULT_NAME,
120119
sw_version=self.fw_version,

custom_components/pijups/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"documentation": "https://github.com/modrisb/pijups/",
55
"issue_tracker": "https://github.com/modrisb/pijups/issues",
66
"requirements": ["smbus2==0.4.1"],
7-
"version": "1.2.3",
7+
"version": "1.2.4",
88
"dependencies": [],
99
"codeowners": ["@modrisb"],
1010
"config_flow": true,

custom_components/pijups/pijuice.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
import threading
77
import time
8+
import logging
89

910
from smbus2 import SMBus
1011

@@ -23,6 +24,7 @@
2324
"USER_FUNC" + str(i + 1) for i in range(0, 15)
2425
]
2526

27+
_LOGGER = logging.getLogger(__name__)
2628

2729
class PiJuiceInterface(object):
2830
def __init__(self, bus=1, address=0x14):
@@ -82,13 +84,15 @@ def _Write(self):
8284

8385
def _DoTransfer(self, oper):
8486
self.force = True if (self.t is not None and self.t.is_alive()) else None
87+
#_LOGGER.debug(f"_DoTransfer force={self.force}")
8588
self.t = threading.Thread(target=oper, args=())
8689
self.t.start()
8790

8891
# wait for transfer to finish or timeout
8992
self.t.join(timeout=0.1)
9093

9194
r_code = not (self.comError or self.t.is_alive())
95+
#_LOGGER.debug(f"_DoTransfer return code={r_code}")
9296
return r_code
9397

9498
def ReadData(self, cmd, length):
@@ -101,6 +105,7 @@ def ReadData(self, cmd, length):
101105
return {"error": "COMMUNICATION_ERROR"}
102106

103107
d = self.d
108+
_LOGGER.info("ReadData cmd 0x%x= %s %x (%x)", cmd, d, d[-1], self._GetChecksum(d[0:-1]))
104109
if self._GetChecksum(d[0:-1]) != d[-1]:
105110
# With n+1 byte data (n data bytes and 1 checksum byte) sometimes the
106111
# MSbit of the first received data byte is 0 while it should be 1. So we
@@ -109,6 +114,8 @@ def ReadData(self, cmd, length):
109114
if self._GetChecksum(d[0:-1]) == d[-1]:
110115
del d[-1]
111116
return {"data": d, "error": "NO_ERROR"}
117+
_LOGGER.info(
118+
"ReadData cmd 0x%x= %x (%x)", cmd, d, self._GetChecksum(d[0:-1]))
112119
return {"error": "DATA_CORRUPTED"}
113120
del d[-1]
114121
return {"data": d, "error": "NO_ERROR"}

custom_components/pijups/translations/en.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,27 @@
8686
},
8787
"selector": {
8888
"battery_profile_status": {
89-
"options" : {
90-
"PJZERO_1000": "PJZERO 1000",
89+
"options": {
90+
"BP6X_1400": "BP6X 1400",
9191
"BP7X_1820": "BP7X 1820",
92-
"SNN5843_2300": "SNN5843 2300",
92+
"PJBP7X_1600": "PJBP7X 1600",
9393
"PJLIPO_12000": "PJLIPO 12000",
94+
"PJLIPO_2500": "PJLIPO 2500",
95+
"PJLIPO_500": "PJLIPO 500",
9496
"PJLIPO_5000": "PJLIPO 5000",
95-
"PJBP7X_1600": "PJBP7X 1600",
97+
"PJLIPO_600": "PJLIPO 600",
9698
"PJSNN5843_1300": "PJSNN5843 1300",
99+
"PJZERO_1000": "PJZERO 1000",
97100
"PJZERO_1200": "PJZERO 1200",
98-
"BP6X_1400": "BP6X 1400",
99-
"PJLIPO_600": "PJLIPO 600",
100-
"PJLIPO_500": "PJLIPO 500",
101-
"PJLIPO_2500": "PJLIPO 2500"
101+
"SNN5843_2300": "SNN5843 2300"
102102
}
103103
},
104104
"battery_temp_sense_config": {
105105
"options": {
106+
"AUTO_DETECT": "HAT to select sensor",
106107
"NOT_USED": "temperature not measured",
107108
"NTC": "use battery sensor",
108-
"ON_BOARD": "use on board sensor",
109-
"AUTO_DETECT": "HAT to select sensor"
109+
"ON_BOARD": "use on board sensor"
110110
}
111111
},
112112
"diag_log_config": {
@@ -121,4 +121,4 @@
121121
}
122122
}
123123
}
124-
}
124+
}

0 commit comments

Comments
 (0)