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: add day of week to BACnet protocol binding's Date and DateTime types #381

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
37 changes: 32 additions & 5 deletions bindings/protocols/bacnet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,12 @@ <h3>WoT Data Schema and BACnet Types</h3>
<code>
{
"type": "string",
"pattern": "pattern": "^((([1-9][0-9]*)?[0-9]{4})|\\*)-((1[0-2]|0[1-9])|\\*)-((3[01]|0[1-9]|[12][0-9])|\\*)T((2[0-3]|[01][0-9])|\\*):([0-5][0-9]|\\*):([0-5][0-9]|\\*)(\\.[0-9]+)?(Z|[+-]\\d\\d:\\d\\d)?$",,
"$comment": "ISO8601 Date Time Format with optional wildcards"
"pattern": "^((([1-9][0-9]*)?[0-9]{4})|\\*)-((1[0-2]|0[1-9])|O|E|\\*)-((3[01]|0[1-9]|[12][0-9])|O|E|\\*)(\\s*\\([1-7\\*]\\))?T((2[0-3]|[01][0-9])|\\*):([0-5][0-9]|\\*):([0-5][0-9]|\\*)(\\.[0-9]+)?(Z|[+-]\\d\\d:\\d\\d)?$",
"$comment": "A recurrence rule format based on ISO8601, specifies repeating dates and times using year, month, day, hour, minute, second, and optionally day of week (1: Mon, 7: Sun). Supports wildcards: 'O' for odd values, 'E' for even values, and '*' for any valid value in each component."
}
</code>
<br />
Please see <code>bacv:Date</code> and <code>bacv:Time</code> about the details of wildcards.
</td>
<td>
<code>
Expand Down Expand Up @@ -745,10 +747,28 @@ <h3>WoT Data Schema and BACnet Types</h3>
<code>
{
"type": "string",
"pattern": "^((([1-9][0-9]*)?[0-9]{4})|\\*)-((1[0-2]|0[1-9])|\\*)-((3[01]|0[1-9]|[12][0-9])|\\*)$",
"$comment": "ISO8601 Date Format with optional wildcards"
"pattern": "^((([1-9][0-9]*)?[0-9]{4})|\\*)-((1[0-2]|0[1-9])|O|E|\\*)-((3[01]|0[1-9]|[12][0-9])|O|E|\\*)(\\s*\\([1-7\\*]\\))?$",
"$comment": "A recurrence rule format based on ISO8601, specifies repeating dates using year, month, day, and optionally day of week (1: Mon, 7: Sun). Supports wildcards: 'O' for odd days, 'E' for even days, and '*' for any valid value in each component."
}
</code>

<ul>
<li><code>O</code> and <code>E</code> can be used in the months field to indicate odd (1: Jan, 3: Mar...) and even (2: Feb, 4: Apr...) months.</li>
<li><code>O</code> and <code>E</code> can be used in the day of week field to indicate odd and even days of the month.</li>
<li><code>*</code> can be used for any year, month, day of month or day of week.</li>
<li>Examples
<ul>
<li><code>*-*-01</code>: Recurs on the 1st day of every month, regardless of year.</li>
<li><code>*-06-* (1)</code>: Recurs on every Monday in June, regardless of year.</li>
<li><code>*-E-01</code>: Recurs on the 1st day of every even month, regardless of year.</li>
<li>
<code>2024-11-07 (1)</code>: November 7, 2024, is not a Monday, resulting in no recurrences.
</li>
<li><code>2024-11-07 (4)</code> / <code>2024-11-07</code>: November 7, 2024, is a Thursday, resulting in a single recurrence.</li>
<li><code>*-*-* (*)</code> / <code>*-*-*</code>: Recurs every day, regardless of year, month, or day of the week.</li>
</ul>
</li>
</ul>
</td>
<td>
<code>
Expand All @@ -767,9 +787,16 @@ <h3>WoT Data Schema and BACnet Types</h3>
{
"type": "string",
"pattern": "^((2[0-3]|[01][0-9])|\\*):([0-5][0-9]|\\*):([0-5][0-9]|\\*)(\\.[0-9]+)?(Z|[+-]\\d\\d:\\d\\d)?$",
"$comment": "ISO8601 Time Format with optional wildcards"
"$comment": "A recurrence rule format based on ISO8601, specifies repeating times using hour, minute, and second. Supports the '*' wildcard for any valid value in each component."
}
</code>

Examples:
<ul>
<li><code>*:00:00Z</code>: Recurs every hour on the hour (00 minutes, 00 seconds), using Coordinated Universal Time (UTC).</li>
<li><code>*:*:*</code>: Recurs every second of every minute and every hour, essentially occurring continuously throughout the day.</li>
<li><code>06:00:00Z</code>: Occurs at 6:00 AM UTC, with 0 minutes and 0 seconds past the hour.</li>
</ul>
</td>
<td>
<code>
Expand Down