Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix JSON Bool (OpenDTU-API) #249

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading