Skip to content

Commit

Permalink
bump: Update dwd_global_rad_api_server to version 1.4.6
Browse files Browse the repository at this point in the history
- Added /status endpoint to check if the API server is running and reachable.
- Implemented /locations/<name> DELETE endpoint to remove a specific location by name.
- Updated logging configuration for better debugging.
- Enhanced error handling and response messages for the new endpoints.
  • Loading branch information
aschmere committed Jun 12, 2024
1 parent 939b26a commit 6c5cc3f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions dwd_global_rad_api_server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,20 @@ def fetch_measurements():
return jsonify({'error': 'Forecast data not found'}), 404

return jsonify({'message': 'Measurement data is available'}), 200

@app.route('/locations/<name>', methods=['DELETE'])
def remove_location(name):
"""Remove a specific location by name."""
try:
objGlobalRadiation.remove_location(name)
return jsonify({'status': 'Location removed successfully'}), 200
except ValueError as e:
return jsonify({'error': str(e)}), 404
@app.route('/status', methods=['GET'])

def get_status():
"""Endpoint to check if the API server is running."""
return '', 204 # No Content status

if __name__ == '__main__':
app.run(host='0.0.0.0', port=5001)
2 changes: 1 addition & 1 deletion dwd_global_rad_api_server/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
name: DWD Global Rad Api Server
version: "1.4.5"
version: "1.4.6"
slug: dwd_global_rad_api_server
description: DWD Global Rad Api Server
arch:
Expand Down

0 comments on commit 6c5cc3f

Please sign in to comment.