Skip to content

Commit 32bcb03

Browse files
committed
Initial release
1 parent 1864937 commit 32bcb03

34 files changed

Lines changed: 3779 additions & 2048 deletions

.DS_Store

2 KB
Binary file not shown.

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
.DS_Store
2+
.env
3+
venv/
24
__pycache__/
35
*.pyc
4-
env/
5-
venv/
6-
.idea/
7-
.vscode/
8-
*.log
6+
*.pyo
7+
*.pyd
8+
docker-compose.yml
9+
Dockerfile
10+
test_api.py
11+
test.json
12+
test.sh
13+
docker/

CHANGELOG.md

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,24 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

7-
## [1.0.0] (2025-10-03)
8+
## [Unreleased]
89

9-
### Initial Release
10-
A Home Assistant integration for HTTP operations with template support and automatic sensor polling.
10+
## [1.0.0] - 2025-10-08
1111

1212
### Added
13-
- **HTTP Services**: Complete HTTP request service with support for all major methods (GET, POST, PUT, DELETE, PATCH, HEAD)
14-
- **Template Engine**: Full Home Assistant template support for URLs, payloads, query parameters, and headers
15-
- **HTTP Sensors**: Automatic polling sensors with configurable intervals and response extraction
16-
- **GUI Configuration**: Complete web-based configuration flow for easy setup and management
17-
- **Sensor Management**: Add, edit, and delete HTTP sensors through the GUI
18-
- **SSL Options**: Configurable SSL verification settings for secure connections
19-
- **Multi-language Support**: Translations for 8 languages (English, Swedish, Danish, Finnish, Norwegian, German, Spanish, French)
20-
- **Error Handling**: Comprehensive error handling with proper logging and user feedback
21-
- **Status Indicators**: Dynamic icons based on HTTP response status codes
22-
- **Session Management**: Efficient HTTP session handling with proper cleanup
23-
- **Response Validation**: Built-in response validation and error reporting
24-
- **Development Tools**: Complete development environment with linting, formatting, and testing
25-
26-
### Technical Details
27-
- **Integration Type**: Hub with local polling
28-
- **Minimum HA Version**: 2024.10+
29-
- **Python Dependencies**: aiohttp>=3.8.0
30-
- **Code Quality**: Black formatting, isort import sorting, flake8 linting, mypy type checking
31-
- **Testing**: Comprehensive GitHub Actions workflows for CI/CD
32-
- **Validation**: HACS and Hassfest validation for Home Assistant compliance
33-
34-
This marks the first stable release of HTTP Agent, providing a robust foundation for HTTP operations in Home Assistant with enterprise-grade features and Home Assistant best practices.
13+
- Initial release of HTTP Agent integration
14+
- Multi-step configuration wizard (URL → Headers → Payload → Sensors)
15+
- Support for multiple extraction methods (JSON, XML, CSS)
3516

36-
[keep-a-changelog]: http://keepachangelog.com/en/1.0.0/
37-
[1.0.0]: https://github.com/dsorlov/http_agent
17+
### Features
18+
- HTTP methods: GET, POST, PUT, DELETE, PATCH
19+
- Content types: JSON, XML, form-data, plain text
20+
- Template rendering for URLs, headers, and payloads
21+
- Dynamic sensor configuration
22+
- Error handling and logging
23+
- Configurable timeout and update intervals
24+
- Authentication support via headers

CONTRIBUTING.md

Lines changed: 143 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,167 @@
11
# Contributing to HTTP Agent
22

3-
Thank you for your interest in contributing to HTTP Agent! We welcome contributions of all kinds.
3+
Thank you for your interest in contributing to HTTP Agent! We welcome contributions from the community.
44

55
## How to Contribute
66

77
### Reporting Bugs
8-
- Use the GitHub issue tracker
9-
- Follow the bug report template
10-
- Include logs with debug logging enabled
11-
- Provide clear reproduction steps
12-
13-
### Requesting Features
14-
- Use the GitHub issue tracker
15-
- Follow the feature request template
16-
- Explain the use case clearly
17-
- Consider backward compatibility
18-
19-
### Code Contributions
20-
21-
#### Development Setup
22-
1. Fork the repository
23-
2. Clone your fork
24-
3. Install development dependencies:
8+
9+
If you find a bug, please create an issue on GitHub with the following information:
10+
11+
- **Description**: A clear description of the bug
12+
- **Steps to Reproduce**: Detailed steps to reproduce the issue
13+
- **Expected Behavior**: What you expected to happen
14+
- **Actual Behavior**: What actually happened
15+
- **Environment**:
16+
- Home Assistant version
17+
- HTTP Agent version
18+
- Browser (if UI-related)
19+
- **Logs**: Relevant error messages or logs from Home Assistant
20+
21+
### Suggesting Enhancements
22+
23+
We welcome feature requests! Please create an issue with:
24+
25+
- **Description**: A clear description of the enhancement
26+
- **Use Case**: Why this feature would be useful
27+
- **Proposed Solution**: If you have ideas on how to implement it
28+
29+
### Pull Requests
30+
31+
We actively welcome pull requests!
32+
33+
#### Before You Start
34+
35+
1. Check existing issues and PRs to avoid duplicates
36+
2. For major changes, please open an issue first to discuss
37+
3. Fork the repository and create a branch from `main`
38+
39+
#### Code Guidelines
40+
41+
- **Code Style**: Follow PEP 8 guidelines
42+
- **Formatting**: Use `black` for code formatting:
43+
```bash
44+
black custom_components/
45+
```
46+
- **Import Sorting**: Use `isort` for import organization:
47+
```bash
48+
isort custom_components/
49+
```
50+
- **Linting**: Run `flake8` to check for issues:
51+
```bash
52+
flake8 custom_components/ --count --select=E9,F63,F7,F82 --show-source --statistics
53+
```
54+
55+
#### Testing
56+
57+
Before submitting a PR, ensure:
58+
59+
1. **Code Quality Checks Pass**:
60+
```bash
61+
black --check custom_components/
62+
isort --check-only custom_components/
63+
flake8 custom_components/ --count --select=E9,F63,F7,F82 --show-source --statistics
64+
```
65+
66+
2. **Python Syntax Validation**:
2567
```bash
26-
pip install -r requirements-dev.txt
68+
python -m py_compile custom_components/http_agent/*.py
2769
```
2870

29-
#### Code Standards
30-
- Follow PEP 8 style guidelines
31-
- Use Black for code formatting: `black custom_components/http_agent`
32-
- Sort imports with isort: `isort custom_components/http_agent`
33-
- Run flake8 for linting: `flake8 custom_components/http_agent`
71+
3. **API Tests Pass**:
72+
```bash
73+
python3 test_api.py
74+
```
3475

35-
#### Testing
36-
- Ensure all GitHub Actions pass
37-
- Test with different Home Assistant versions if possible
38-
- Add tests for new features when applicable
76+
4. **Integration Works**: Test in Home Assistant using the Docker environment
3977

40-
#### Pull Requests
41-
1. Create a feature branch from `main`
42-
2. Make your changes
43-
3. Ensure all tests pass
44-
4. Update documentation if needed
45-
5. Submit a pull request with a clear description
78+
#### Translation Guidelines
79+
80+
If adding or modifying translations:
81+
82+
1. Always update `custom_components/http_agent/strings.json` first
83+
2. Update all language files in `custom_components/http_agent/translations/`:
84+
- `en.json` (English)
85+
- `sv.json` (Swedish)
86+
- `da.json` (Danish)
87+
- `de.json` (German)
88+
- `fi.json` (Finnish)
89+
- `no.json` (Norwegian)
90+
3. Ensure all files maintain the same key structure (203 keys)
91+
4. Validate JSON syntax:
92+
```bash
93+
python3 -m json.tool custom_components/http_agent/translations/LANGUAGE.json
94+
```
4695

4796
#### Commit Messages
97+
4898
- Use clear, descriptive commit messages
49-
- Start with a verb (Add, Fix, Update, etc.)
50-
- Keep the first line under 50 characters
51-
- Add details in the body if needed
99+
- Start with a verb in present tense (e.g., "Add", "Fix", "Update")
100+
- Reference issue numbers when applicable
52101

53-
## Development Guidelines
102+
Example:
103+
```
104+
Add support for custom authentication headers (#123)
54105
55-
### Code Structure
56-
- Follow Home Assistant integration patterns
57-
- Use async/await for I/O operations
58-
- Handle errors gracefully
59-
- Add proper logging
106+
- Add new config flow step for auth configuration
107+
- Update coordinator to handle auth headers
108+
- Add tests for authentication
109+
```
110+
111+
#### Pull Request Process
112+
113+
1. Update documentation if needed
114+
2. Update CHANGELOG.md with your changes
115+
3. Ensure all CI checks pass
116+
4. Request review from maintainers
117+
5. Address any feedback
60118

61119
### Documentation
62-
- Update README.md for user-facing changes
63-
- Update docstrings for code changes
64-
- Add examples for new features
65120

66-
### Internationalization
67-
- Add translation keys to all language files
68-
- Use descriptive translation keys
69-
- Test with different languages
121+
- Update README.md if you change functionality
122+
- Add code comments for complex logic
123+
- Update configuration examples if needed
124+
125+
## Code of Conduct
126+
127+
### Our Pledge
128+
129+
We are committed to providing a welcoming and inclusive environment for everyone.
70130

71-
## Getting Help
131+
### Our Standards
72132

73-
- Check existing issues and pull requests
74-
- Ask questions in GitHub Discussions
75-
- Join the Home Assistant community forums
133+
Examples of behavior that contributes to a positive environment:
134+
135+
- Using welcoming and inclusive language
136+
- Being respectful of differing viewpoints
137+
- Gracefully accepting constructive criticism
138+
- Focusing on what is best for the community
139+
- Showing empathy towards others
140+
141+
Examples of unacceptable behavior:
142+
143+
- Harassment or discriminatory language
144+
- Trolling or insulting comments
145+
- Personal or political attacks
146+
- Publishing others' private information
147+
- Other conduct which could reasonably be considered inappropriate
148+
149+
### Enforcement
150+
151+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainers. All complaints will be reviewed and investigated promptly and fairly.
152+
153+
## Questions?
154+
155+
If you have questions, feel free to:
156+
157+
- Open an issue for discussion
158+
- Check existing documentation
159+
- Review closed issues and PRs
76160

77161
## License
78162

79-
By contributing, you agree that your contributions will be licensed under the MIT License.
163+
By contributing, you agree that your contributions will be licensed under the same license as the project (see LICENSE file).
164+
165+
---
166+
167+
Thank you for contributing to HTTP Agent! 🎉

0 commit comments

Comments
 (0)