Skip to content

Commit

Permalink
Merge pull request #249 from reserve85/dev
Browse files Browse the repository at this point in the history
fix JSON Bool (OpenDTU-API)
  • Loading branch information
reserve85 authored Oct 9, 2024
2 parents c4d96e4 + d57fe5f commit b19a165
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## V 1.104
### script
* fix JSON-Boolean Value in OpenDTU API (https://github.com/reserve85/HoymilesZeroExport/issues/247)

## V 1.103
### script
* removed SetLimit, SetLimitWithPriority -> only one Function for SetLimit (same routine for mixed mode, battery mode, non battery mode)
Expand Down
4 changes: 2 additions & 2 deletions HoymilesZeroExport.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__author__ = "Tobias Kraft"
__version__ = "1.103"
__version__ = "1.104"

import time
from requests.sessions import Session
Expand Down Expand Up @@ -1085,7 +1085,7 @@ def SetPowerStatus(self, pInverterId: int, pActive: bool):
logger.info('OpenDTU: Inverter "%s": Turn on',NAME[pInverterId])
else:
logger.info('OpenDTU: Inverter "%s": Turn off',NAME[pInverterId])
mySendStr = f'''data={{"serial":"{SERIAL_NUMBER[pInverterId]}", "power":{CastToInt(pActive == True)}}}'''
mySendStr = f'''data={{"serial":"{SERIAL_NUMBER[pInverterId]}", "power":{json.dumps(pActive)}}}'''
response = self.GetResponseJson('/api/power/config', mySendStr)
if response['type'] != 'success':
raise Exception(f"Error: SetPowerStatus error: {response['message']}")
Expand Down

0 comments on commit b19a165

Please sign in to comment.