Skip to content

Commit

Permalink
Merge branch 'main' into f_relay
Browse files Browse the repository at this point in the history
  • Loading branch information
FredM67 committed Jul 1, 2023
2 parents dc1a24b + 59084e7 commit 24b867c
Show file tree
Hide file tree
Showing 21 changed files with 657 additions and 152 deletions.
67 changes: 35 additions & 32 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Development environment:**
- IDE: [e.g. Arduino IDE]
- OS: [e.g. iOS]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
name: 🐞 Bug
description: File a bug/issue
title: '<title>'
labels: [bug]
body:
- type: textarea
attributes:
label: Current Behavior
description: A description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Reproduction / Steps To Reproduce
description: Link to a repository with steps to reproduce the behavior.
placeholder: |
As you can see in this code example/repostitory
1. Using this component...
2. With these properties...
3. Click '...'
4. See error...
validations:
required: false
- type: markdown
attributes:
value: |
Bug Reports with a repository with a full reproduction can be anwswered far quicker, so please consider including as much information as possible to let us help you quicker!
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
contact_links:
- name: Are you looking for documentation on REPO_NAME?
url: https://USERNAME.github.io/REPO_NAME
about: Please see the documentation for REPO_NAME on its GitHub Pages page.
- name: Do want to discuss REPO_NAME with the community?
url: https://github.com/USERNAME/REPO_NAME/discussions
about: Please see the discussions page for REPO_NAME.
blank_issues_enabled: true
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/docs_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 📗 Report Docs Issue
description: See a typo? Outdated or incorrect information? Let us know!
title: '<title>'
labels: [documentation]
body:
- type: markdown
attributes:
value: Sometimes something slips through the cracks, and the documentation is not quite right. Thanks for letting us know!
- type: input
id: link
attributes:
label: Link to the Page
- type: textarea
id: quote
attributes:
label: Describe the Issue
- type: dropdown
id: participate
attributes:
label: Are you able to create a Pull Request with the fix?
options:
- 'Yes'
- 'No'
42 changes: 22 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
name: 🛠️ Request New Feature
description: Let us know what we should add.
labels: ['feature request']
body:
- type: textarea
id: description
attributes:
label: Describe what feature you'd like. Pseudo-code, mockups, or screenshots of similar solutions are encouraged!
- type: dropdown
id: category
attributes:
label: What type of pull request would this be?
options:
- 'New Feature'
- 'Enhancement'
- 'Guide'
- 'Docs'
- 'Other'
- type: textarea
id: references
attributes:
label: Any links to similar examples or other references we should review?
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Pull request

## Proposed changes

<!-- Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. -->

## Types of changes

<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] New feature (non-breaking change which adds functionality).
- [ ] Enhancement (non-breaking change which enhances functionality)
- [ ] Bug Fix (non-breaking change which fixes an issue).
- [ ] Breaking change (fix or feature that would cause existing functionality to change).

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] I have read the **[README](./README.md)** document.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
uses: actions/dependency-review-action@v3
2 changes: 1 addition & 1 deletion .github/workflows/doxygen-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: DenverCoder1/doxygen-github-pages-action@v1.2.0
- uses: DenverCoder1/doxygen-github-pages-action@v1.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
config_file: Doxyfile
52 changes: 28 additions & 24 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Expand All @@ -22,17 +22,17 @@ community include:
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

Expand Down Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
.
[[email protected]].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand All @@ -82,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

Expand All @@ -106,23 +106,27 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
5 changes: 5 additions & 0 deletions Mk2_3phase_RFdatalog_temp/Mk2_3phase_RFdatalog_temp.ino
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@
* - project can now be used with both Arduino IDE and PlatformIO (Visual Studio Code).
* - a couple of pre-defined PlatformIO configs added
*
* __June 2023: changes:__
* - heavy refactoring (again)
* - stl add-ons
* - add relay-output feature
*
* @author Fred Metrich
* @copyright Copyright (c) 2023
*
Expand Down
4 changes: 2 additions & 2 deletions Mk2_3phase_RFdatalog_temp/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ inline constexpr bool OVERRIDE_PIN_PRESENT{ false }; /**< set
#endif

inline constexpr bool WATCHDOG_PIN_PRESENT{ false }; /**< set it to 'true' if there's a watch led */
inline constexpr bool RELAY_DIVERSION{ true }; /**< set it to 'true' if a relay is used for diversion */
inline constexpr bool RELAY_DIVERSION{ false }; /**< set it to 'true' if a relay is used for diversion */
inline constexpr bool DUAL_TARIFF{ false }; /**< set it to 'true' if there's a dual tariff each day AND the router is connected to the billing meter */

// ----------- Pinout assignments -----------
Expand All @@ -75,7 +75,7 @@ inline constexpr bool DUAL_TARIFF{ false }; /**< set it to 'true' if th
inline constexpr uint8_t physicalLoadPin[NO_OF_DUMPLOADS]{ 5, 7 }; /**< for 3-phase PCB, Load #1/#2/#3 (Rev 2 PCB) */
inline uint8_t loadPrioritiesAndState[NO_OF_DUMPLOADS]{ 0, 1 }; /**< load priorities and states at startup */

inline constexpr uint8_t relayPin{ 9 }; /**< for 3-phase PCB, relay trigger */
inline constexpr uint8_t relayPin{ 0xff }; /**< for 3-phase PCB, relay trigger */
inline constexpr uint8_t dualTariffPin{ 0xff }; /**< for 3-phase PCB, off-peak trigger */
inline constexpr uint8_t diversionPin{ 0xff }; /**< if LOW, set diversion on standby */
inline constexpr uint8_t rotationPin{ 0xff }; /**< if LOW, trigger a load priority rotation */
Expand Down
10 changes: 10 additions & 0 deletions Mk2_3phase_RFdatalog_temp/movingAvg.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/**
* @file movingAvg.h
* @author Frédéric Metrich ([email protected])
* @brief Code for sliding-window average
* @version 0.1
* @date 2023-06-14
*
* @copyright Copyright (c) 2023
*
*/

#ifndef MOVINGAVG_H
#define MOVINGAVG_H
Expand Down
4 changes: 2 additions & 2 deletions Mk2_3phase_RFdatalog_temp/processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void processCurrentRawSample(const uint8_t phase, const int16_t rawSample)

// extra filtering to offset the HPF effect of CTx
const int32_t last_lpf_long{ lpf_long[phase] };
lpf_long[phase] = last_lpf_long + alpha * (sampleIminusDC - last_lpf_long);
lpf_long[phase] += alpha * (sampleIminusDC - last_lpf_long);
sampleIminusDC += (lpf_gain * lpf_long[phase]);

// calculate the "real power" in this sample pair and add to the accumulated sum
Expand Down Expand Up @@ -633,8 +633,8 @@ void processLatestContribution(const uint8_t phase)
// apply any adjustment that is required.
if (0 == phase)
{
b_newMainsCycle = true; // a 50 Hz 'tick' for use by the main code
f_energyInBucket_main -= REQUIRED_EXPORT_IN_WATTS; // energy scale is Joules x 50
b_newMainsCycle = true; // a 50 Hz 'tick' for use by the main code
}
// Applying max and min limits to the main accumulator's level
// is deferred until after the energy related decisions have been taken
Expand Down
11 changes: 11 additions & 0 deletions Mk2_3phase_RFdatalog_temp/type_traits.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* @file type_traits.hpp
* @author Frédéric Metrich ([email protected])
* @brief Some useful but missing stl functions templates
* @version 0.1
* @date 2023-06-14
*
* @copyright Copyright (c) 2023
*
*/

// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2023, Benoit BLANCHON
// MIT License
Expand Down
2 changes: 1 addition & 1 deletion Mk2_3phase_RFdatalog_temp/utils_relay.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file utils_relay.h
* @author Frédéric Metrich ([email protected])
* @brief
* @brief Some utility functions for the relay output feature
* @version 0.1
* @date 2023-03-31
*
Expand Down
Loading

0 comments on commit 24b867c

Please sign in to comment.