From af3d02e7c668db7688df3837138b3d9f08f8683e Mon Sep 17 00:00:00 2001 From: akloeckner Date: Sun, 28 Jan 2024 14:40:11 +0100 Subject: [PATCH 1/7] chore: archive build artefacts for non-dev testers (#1064) --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1961df09..30f38461 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,3 +54,9 @@ jobs: run: npm ci - name: Build the project run: npm run build --if-present + - name: Archive distribution bundle + uses: actions/upload-artifact@v4 + with: + name: dist-node${{ matrix.node-version }} + path: | + dist From 930ee39f51744bc11f580f4198f579b5213371ca Mon Sep 17 00:00:00 2001 From: akloeckner Date: Sun, 28 Jan 2024 17:31:45 +0100 Subject: [PATCH 2/7] fix: tooltip interval start could be after end (#1065) * basically: use milliseconds in constants rather than fractions of hours * also remove strange interval size of n_points if hours < 1 and points/hour < 1 * also use 1 minute offset for end only when group_by, because that is cosmetics actually fixes #181 --- src/main.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main.js b/src/main.js index 43f806d7..f5316210 100644 --- a/src/main.js +++ b/src/main.js @@ -527,27 +527,34 @@ class MiniGraphCard extends LitElement { setTooltip(entity, index, value, label = null) { const { + group_by, points_per_hour, hours_to_show, format, } = this.config; - const offset = hours_to_show < 1 && points_per_hour < 1 - ? points_per_hour * hours_to_show - : 1 / points_per_hour; - const id = Math.abs(index + 1 - Math.ceil(hours_to_show * points_per_hour)); + // time units in milliseconds in this function + const interval = getMilli(1 / points_per_hour); + const n_points = Math.ceil(hours_to_show * points_per_hour); + + // index is 0 (oldest) to n_points-1 (most recent ~= now) + // count of intervals from now to end of bin + // count is 0 (now) to n_points-1 (oldest) + const count = (n_points - 1) - index; + + // offset end by a minute, if grouped by, e.g., date or hour + const oneMinute = group_by !== 'interval' ? 60000 : 0; const now = this.getEndDate(); - const oneMinInHours = 1 / 60; - now.setMilliseconds(now.getMilliseconds() - getMilli(offset * id + oneMinInHours)); + now.setMilliseconds(now.getMilliseconds() - oneMinute - interval * count); const end = getTime(now, format, this._hass.language); - now.setMilliseconds(now.getMilliseconds() - getMilli(offset - oneMinInHours)); + now.setMilliseconds(now.getMilliseconds() + oneMinute - interval); const start = getTime(now, format, this._hass.language); this.tooltip = { value, - id, + count, entity, time: [start, end], index, From cfa6efe41fd42e7787ea6ae3631cc262058b0dca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:23:16 +0100 Subject: [PATCH 3/7] build(deps): bump amannn/action-semantic-pull-request (#1028) Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 5.2.0 to 5.4.0. - [Release notes](https://github.com/amannn/action-semantic-pull-request/releases) - [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md) - [Commits](https://github.com/amannn/action-semantic-pull-request/compare/v5.2.0...v5.4.0) --- updated-dependencies: - dependency-name: amannn/action-semantic-pull-request dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/semantic-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml index d58aeded..5c8ca490 100644 --- a/.github/workflows/semantic-pull-request.yml +++ b/.github/workflows/semantic-pull-request.yml @@ -12,6 +12,6 @@ jobs: name: Validate PR title runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v5.2.0 + - uses: amannn/action-semantic-pull-request@v5.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From aa5b914ff1366c394cd8ffa98d07662de7fe8fd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:25:24 +0100 Subject: [PATCH 4/7] build(deps): bump actions/setup-node from 3 to 4 (#1024) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30f38461..ce3395e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js 12.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 12.x - name: Cache Node.js modules @@ -39,7 +39,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Cache Node.js modules diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88d83e3e..8764a6aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js 12.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 12.x - name: Cache Node.js modules From a524c97a2f40038ef2cc7d457d1afbb36ecf165d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:26:47 +0100 Subject: [PATCH 5/7] build(deps): bump actions/checkout from 3 to 4 (#1006) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce3395e5..46860e35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 12.x uses: actions/setup-node@v4 with: @@ -37,7 +37,7 @@ jobs: node-version: [10.x, 12.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8764a6aa..5636fbd9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: new_release_version: ${{ steps.semantic.outputs.new_release_version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 12.x uses: actions/setup-node@v4 with: From 629ce76fc30ec729a83af59bcf20981d9139f58a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:21:48 +0100 Subject: [PATCH 6/7] build(deps): bump actions/cache from 2 to 4 (#1070) Bumps [actions/cache](https://github.com/actions/cache) from 2 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46860e35..44c48005 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: with: node-version: 12.x - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node-12.x-${{ hashFiles('**/package-lock.json') }} @@ -43,7 +43,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5636fbd9..aeec7c0e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: with: node-version: 12.x - name: Cache Node.js modules - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.OS }}-node-12.x-${{ hashFiles('**/package-lock.json') }} From 82377477ebe2d6ffd1f6c636f6f0a6dfbfe4baa2 Mon Sep 17 00:00:00 2001 From: akloeckner Date: Mon, 5 Feb 2024 21:03:59 +0100 Subject: [PATCH 7/7] chore: direct dependabot to dev branch and group minor updates (#1071) --- .github/dependabot.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f3499034..6bf7909a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,8 +5,14 @@ updates: schedule: interval: "weekly" open-pull-requests-limit: 0 - target-branch: "develop" + target-branch: "dev" - package-ecosystem: "github-actions" directory: "/" + target-branch: "dev" schedule: interval: "weekly" + groups: + patch-and-minor: + update-types: + - "minor" + - "patch"