Skip to content

Commit

Permalink
fix: Sorting not working (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sese-Schneider committed Dec 29, 2023
1 parent 386af65 commit 19a992d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 63 deletions.
118 changes: 59 additions & 59 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
{
"name": "energy-overview-card",
"version": "2.4.2",
"description": "Lovelace energy-overview-card",
"keywords": [
"home-assistant",
"homeassistant",
"hass",
"automation",
"lovelace",
"custom-cards"
],
"module": "energy-overview-card.js",
"repository": "https://github.com/Sese-Schneider/ha-energy-overview-card",
"author": "Sebastian Schneider <sese.tailor@gmx.net>",
"license": "MIT",
"dependencies": {
"@mdi/js": "^7.1.96",
"custom-card-helpers": "^1.9.0",
"home-assistant-js-websocket": "^4.3.1",
"lit": "^2.0.1"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^9.0.2",
"@semantic-release/release-notes-generator": "^10.0.3",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"conventional-changelog-conventionalcommits": "^5.0.0",
"eslint": "8.2.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.25.2",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"prettier": "^1.16.4",
"rollup": "^3.18.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-typescript2": "^0.24.0",
"rollup-plugin-uglify": "^6.0.2",
"semantic-release": "^20.1.0",
"typescript": "^4.9.4"
},
"scripts": {
"start": "rollup -c --watch --bundleConfigAsCjs",
"build": "npm run lint && rollup -c --bundleConfigAsCjs",
"lint": "eslint src/*.ts",
"rollup": "rollup -c"
}
"name": "energy-overview-card",
"version": "2.5.0",
"description": "Lovelace energy-overview-card",
"keywords": [
"home-assistant",
"homeassistant",
"hass",
"automation",
"lovelace",
"custom-cards"
],
"module": "energy-overview-card.js",
"repository": "https://github.com/Sese-Schneider/ha-energy-overview-card",
"author": "Sebastian Schneider <sese.tailor@gmx.net>",
"license": "MIT",
"dependencies": {
"@mdi/js": "^7.1.96",
"custom-card-helpers": "^1.9.0",
"home-assistant-js-websocket": "^4.3.1",
"lit": "^2.0.1"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^9.0.2",
"@semantic-release/release-notes-generator": "^10.0.3",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"conventional-changelog-conventionalcommits": "^5.0.0",
"eslint": "8.2.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.25.2",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"prettier": "^1.16.4",
"rollup": "^3.18.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-typescript2": "^0.24.0",
"rollup-plugin-uglify": "^6.0.2",
"semantic-release": "^20.1.0",
"typescript": "^4.9.4"
},
"scripts": {
"start": "rollup -c --watch --bundleConfigAsCjs",
"build": "npm run lint && rollup -c --bundleConfigAsCjs",
"lint": "eslint src/*.ts",
"rollup": "rollup -c"
}
}
8 changes: 4 additions & 4 deletions src/energy-overview-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ export class EnergyOverviewCard extends LitElement {
if (this._config.order_by) {
const field = this._config.order_by;
entities.sort((e1, e2) => {
const a = e1[field] ? parseFloat(e1[field]) : 0;
const b = e2[field] ? parseFloat(e2[field]) : 0;
const a = e1[field] ? parseFloat(e1[field].value) : 0;
const b = e2[field] ? parseFloat(e2[field].value) : 0;
return b - a;
});
}
Expand Down Expand Up @@ -264,7 +264,7 @@ export class EnergyOverviewCard extends LitElement {
<div class="main">
<div class="primary label label-leading">${entity.label_leading}</div>
<div class="icon icon-leading">
<ha-icon icon="${entity.icon_leading}"></ha-icon>
<ha-icon icon="${entity.icon_leading!}"></ha-icon>
</div>
<div class="line">
<svg overflow="visible" preserveAspectRatio="xMaxYMid slice"
Expand All @@ -285,7 +285,7 @@ export class EnergyOverviewCard extends LitElement {
</svg>
</div>
<div class="icon icon-trailing">
<ha-icon icon="${entity.icon_trailing}"></ha-icon>
<ha-icon icon="${entity.icon_trailing!}"></ha-icon>
</div>
<div class="primary label label-trailing">${entity.label_trailing}</div>
</div>
Expand Down

0 comments on commit 19a992d

Please sign in to comment.