We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d08f84 commit 58b38bfCopy full SHA for 58b38bf
1 file changed
src/enovates_modbus/eno_one.py
@@ -206,9 +206,12 @@ async def get_ems_limit(self) -> int:
206
async def set_ems_limit(self, limit: int):
207
"""
208
Set EMS limit in mA.
209
+ -1 means no limit and is the accepted sensible negative number.
210
- if limit < -0x7FFF or limit > 0x7FFF:
211
+ if limit < -1 or limit > 0x7FFF:
212
raise ValueError("EMS limit is out of range.")
213
+ if limit < 0:
214
+ limit += 0x10000
215
return await self.write_single(EMSLimit.BASE_ADDRESS, limit)
216
217
async def get_current_offered(self) -> int:
0 commit comments