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

feat: move to typescript & tidy up some code #56

Merged
merged 44 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
41b8b0e
feat: move to typescript & tidy up some code
marksie1988 Aug 14, 2023
75f763d
refactor: remove show and use 0 instead
marksie1988 Aug 14, 2023
8fb9d99
feat: start localize & change text numbers to numbers
marksie1988 Aug 14, 2023
f46c844
refactor: change yes / no to boolean
marksie1988 Aug 14, 2023
7965f98
chore: add workflows for release notes and release
marksie1988 Aug 14, 2023
4b63aee
chore: add templates
marksie1988 Aug 14, 2023
f2e3673
refactor: added defaults file
marksie1988 Aug 15, 2023
fd5cd88
refactor: add more defaults
marksie1988 Aug 15, 2023
35181d4
refactor: add missing feature from main card
marksie1988 Aug 15, 2023
bdb9f11
feat: add support for lux inverter status
marksie1988 Aug 16, 2023
0e9ee6f
chore: update readme
marksie1988 Aug 16, 2023
74ffe68
chore: remove console.log
marksie1988 Aug 16, 2023
c58cf6c
chore: remove console.log
marksie1988 Aug 16, 2023
e4ad91b
docs: move examples to sphinx docs
marksie1988 Aug 16, 2023
f44f54d
chore: add devcontainer example files
marksie1988 Aug 16, 2023
c4059c4
docs: add devcontainer documentation
marksie1988 Aug 16, 2023
9d538dc
chore: rename file
marksie1988 Aug 16, 2023
550c8cd
Merge branch 'master' into typescript
marksie1988 Aug 16, 2023
2ffcb93
refactor: add more translations, remove unnecissary or statements
marksie1988 Aug 16, 2023
a7beba9
Merge remote-tracking branch 'refs/remotes/origin/typescript' into ty…
marksie1988 Aug 16, 2023
43ef141
Chore: Update readme
slipx06 Aug 16, 2023
8abebdd
feat: add unit of measurement to energy cost
marksie1988 Aug 17, 2023
9bb1fcc
refactor: change default currency measurement to blank
marksie1988 Aug 17, 2023
c7f7d39
feat: clicking additional loads shows more-info dialog for full card
slipx06 Aug 17, 2023
a63117b
refactor: fix types
slipx06 Aug 17, 2023
5f5d8f3
refactor: invert ternary operator to remove negations
marksie1988 Aug 17, 2023
33933ae
chore: update error messages
slipx06 Aug 17, 2023
745f3eb
feat: clicking additional loads shows more-info dialog for lite card
slipx06 Aug 17, 2023
3eedda1
fix: issue when energy_cost is not set
marksie1988 Aug 17, 2023
d9fb819
Merge remote-tracking branch 'refs/remotes/origin/typescript' into ty…
marksie1988 Aug 17, 2023
4db0358
chore: rebuild after changes
marksie1988 Aug 17, 2023
bf59974
refactor: add missing remaining solar
slipx06 Aug 17, 2023
fe5b9ce
chore: rebuild code
marksie1988 Aug 17, 2023
5955630
feat: add daily aux load
slipx06 Aug 17, 2023
93eea98
refactor: fix show_solar error
slipx06 Aug 17, 2023
a9f58bd
fix: remaining_solar conditional check
slipx06 Aug 17, 2023
d6990e4
fix: temperature positioning and styling
slipx06 Aug 17, 2023
29d805c
fix: error messages not functioning as expected
marksie1988 Aug 18, 2023
2021b3c
fix: show_aux not hidden correctly
marksie1988 Aug 18, 2023
775d58a
fix: logic when default value is false
slipx06 Aug 18, 2023
6a16327
docs: update documentation
marksie1988 Aug 18, 2023
8c3fa89
fix: show_solar logic on lite card
slipx06 Aug 18, 2023
f13d4a7
Merge remote-tracking branch 'refs/remotes/origin/typescript' into ty…
marksie1988 Aug 18, 2023
af3edea
chore: update/add docs workflow
marksie1988 Aug 18, 2023
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
14 changes: 14 additions & 0 deletions .devcontainer/post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -ex

# Convenience workspace directory for later use
WORKSPACE_DIR=$(pwd)

# Now install all dependencies
yarn install

# Install documentation dependencies
pip3 install -r docs/requirements.txt
pip3 install sphinx-autobuild

echo "Done!"
9 changes: 9 additions & 0 deletions .devcontainer/recommended-Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye

RUN apt update && apt upgrade -y

RUN apt install -y zsh python3 python3-sphinx python3-pip

RUN wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O - | zsh || true

CMD ["zsh"]
33 changes: 33 additions & 0 deletions .devcontainer/recommended-devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "sunsynk-power-flow-card",
"dockerFile": "Dockerfile",
"context": "..",
"customizations": {
"vscode": {
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"terminal.integrated.shell.linux": "/bin/zsh",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
},
"extensions": [
"github.vscode-pull-request-github",
"yzhang.markdown-all-in-one",
"bierner.lit-html",
"runem.lit-plugin",
"davidanson.vscode-markdownlint",
"redhat.vscode-yaml",
"eamodio.gitlens",
"ms-python.python",
"tht13.html-preview-vscode",
"sourcery.sourcery",
"tabnine.tabnine-vscode",
"trond-snekvik.simple-rst"
]
}
},
"postCreateCommand": "zsh ./.devcontainer/post-install.sh"
}
15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
//extends: [
// 'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
// 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
//],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
experimentalDecorators: true,
},
rules: {
"@typescript-eslint/camelcase": 0
}
};
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Bug report
description: File a bug report
labels: ["type/bug"]
body:
- type: markdown
attributes:
value: |
**NOTE:** Before you start, the following should be completed.

- Read the documentation to ensure the correct setup.
- Make sure no [similar issues(including closed ones)](https://github.com/slipx06/sunsynk-power-flow-card/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fbug) exists.
- Make sure the request is based on the latest release.

Thanks for taking the time to assist with improving this project!
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: current-behavior
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
id: expected-behaviour
attributes:
label: Expected behaviour
description: A concise description of what you expected to happen.
placeholder: Tell us what you should see!
validations:
required: true
- type: input
id: card-version
attributes:
label: Card Version
description: The version of the card you have installed
validations:
required: true
- type: input
id: ha-version
attributes:
label: Home Assistant Version
description: The version of Home Assistant you have installed
validations:
required: true
- type: textarea
id: config
attributes:
label: Configuration
description: Please copy and paste your configuration. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: false
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

blank_issues_enabled: false
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Feature request
description: Suggest an idea for this project
labels: ['type/feature']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to assist with improving this project!
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the feature you are requesting.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: current-behavior
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: Expected behaviour
description: A concise description of what you expected to happen.
placeholder: Tell us what you should see!
validations:
required: true
- type: textarea
attributes:
label: Possible Solutions
description: If you have an idea on how to implement this please let us know.
validations:
required: false
- type: dropdown
id: mode
attributes:
label: Mode
description: What mode does this feature apply to?
options:
- Event (default)
- Calendar
- Both
validations:
required: true
- type: textarea
attributes:
label: Context / Reason
description: Providing context helps us come up with a solution that is most useful in the real world.
validations:
required: true
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--- Provide a general summary of your changes in the Title above. -->

## Description
<!--- Describe your changes in detail. -->
<!--- If the change is breaking, it must be detailed what breaks and what users need to do to fix it -->

## Related issues
<!--- This project only accepts pull requests related to open issues. -->
<!--- If suggesting a new feature or change, please discuss it in an issue first. -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce. -->
<!--- Please link to the issue here. e.g. fixes #123 closes #123 -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? What additions does it bring? -->

## How has this been tested
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of the tests you ran. -->

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I have updated the version in `package.json` following [semver](https://semver.org/)

31 changes: 31 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
changelog:
categories:
- title: 💥 Breaking Changes
labels:
- semver/major
- flag/breaking changes
- title: 🚀 Exciting New Features
labels:
- semver/minor
- type/feat
- enhancement
- title: 🐛 Patches & Bug Fixes
labels:
- semver/patch
- type/bug
- bug
- title: 📚 Documentation
labels:
- type/docs
- documentation
- title: 📔 Language
labels:
- type/language
- language
- title: ⬆️ Dependencies
labels:
- type/dependencies
- dependencies
- title: Other Changes
labels:
- "*"
6 changes: 3 additions & 3 deletions .github/workflows/HACS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
- cron: "0 0 * * *"

jobs:
hacs:
name: HACS Action
validate-hacs:
runs-on: "ubuntu-latest"
steps:
- name: HACS Action
- uses: "actions/checkout@v3"
- name: HACS validation
uses: "hacs/action@main"
with:
category: "plugin"
24 changes: 24 additions & 0 deletions .github/workflows/pull_requests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---

name: Pull Requests

on:
pull_request:
branches:
- master
workflow_dispatch:
jobs:
checkVersion:
if: github.event_name == 'pull_request'

name: Check version updated
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
# Use this GitHub Action
- name: Check package version
uses: dudo/tag_check@master
with:
git_tag_prefix: v
Loading
Loading