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 9 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
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
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:
- "*"
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
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: release

on:
push:
tags:
- "v*"
workflow_dispatch:

jobs:
release:
name: Create release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Getting your configuration from GitHub
uses: actions/checkout@v2
- name: 🛎️ Create release
id: create_release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
- name: 🏷️ Update latest tag
uses: EndBug/latest-tag@latest
94 changes: 94 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
dist/*
!dist/sunsynk-power-flow-card.js

.devcontainer/*
!.devcontainer/recommended-devcontainer.json
!.devcontainer/recommended-Dockerfile

.vscode/*

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.map
package-lock.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
undefined/

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

docs/_build
Empty file added .nojekyll
Empty file.
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 120,
useTabs: true,
tabWidth: 2
}
Loading