Skip to content

Commit

Permalink
Merge pull request #84 from iantrich/upgrade-deps
Browse files Browse the repository at this point in the history
upgrade deps
  • Loading branch information
iantrich authored Oct 6, 2021
2 parents b8f4526 + 2723462 commit d7bedfe
Show file tree
Hide file tree
Showing 7 changed files with 1,603 additions and 928 deletions.
1 change: 1 addition & 0 deletions .devcontainer/ui-lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ views:
style:
top: 80.3%
left: 77.6%
opacity: 10%
entities:
- switch.ceiling_fan
element:
Expand Down
20 changes: 9 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // 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.
],
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
experimentalDecorators: true,
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module" // Allows for the use of imports
},
extends: [
"plugin:@typescript-eslint/recommended" // Uses the recommended rules from the @typescript-eslint/eslint-plugin
],
rules: {
"@typescript-eslint/camelcase": 0
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
}
};
};
44 changes: 23 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,33 @@
"author": "Ian Richardson <[email protected]>",
"license": "MIT",
"dependencies": {
"custom-card-helpers": "^1.6.6",
"deep-clone-simple": "^1.1.1",
"home-assistant-js-websocket": "^4.4.0",
"lit-element": "^2.4.0",
"lit-html": "^1.3.0"
"custom-card-helpers": "^1.7.2",
"home-assistant-js-websocket": "^5.11.1",
"lit": "^2.0.0-rc.2"
},
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@typescript-eslint/eslint-plugin": "^2.6.0",
"@typescript-eslint/parser": "^2.6.0",
"eslint": "^6.6.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.1",
"prettier": "^1.18.2",
"rollup": "^1.26.0",
"rollup-plugin-babel": "^4.3.3",
"@babel/core": "^7.15.0",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-decorators": "^7.14.5",
"@rollup/plugin-json": "^4.1.0",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.4.1",
"rollup": "^2.58.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-serve": "^1.0.1",
"rollup-plugin-typescript2": "^0.24.3",
"rollup-plugin-uglify": "^6.0.3",
"typescript": "^3.6.4"
"rollup-plugin-serve": "^1.1.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-uglify": "^6.0.4",
"typescript": "^4.4.3"
},
"scripts": {
"start": "rollup -c rollup.config.dev.js --watch",
Expand Down
32 changes: 19 additions & 13 deletions src/config-template-card.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import {
LitElement,
html,
customElement,
property,
TemplateResult,
PropertyValues,
internalProperty,
} from 'lit-element';
import { LitElement, html, customElement, property, TemplateResult, PropertyValues, state } from 'lit-element';
import deepClone from 'deep-clone-simple';
import { HomeAssistant } from 'custom-card-helpers';
import { computeCardSize, HomeAssistant, LovelaceCard } from 'custom-card-helpers';

import { ConfigTemplateConfig } from './types';
import { CARD_VERSION } from './const';
Expand All @@ -23,8 +15,8 @@ console.info(
@customElement('config-template-card')
export class ConfigTemplateCard extends LitElement {
@property({ attribute: false }) public hass?: HomeAssistant;
@internalProperty() private _config?: ConfigTemplateConfig;
@internalProperty() private _helpers?: any;
@state() private _config?: ConfigTemplateConfig;
@state() private _helpers?: any;
private _initialized = false;

public setConfig(config: ConfigTemplateConfig): void {
Expand Down Expand Up @@ -85,6 +77,18 @@ export class ConfigTemplateCard extends LitElement {
return true;
}

public getCardSize(): number | Promise<number> {
if (this.shadowRoot) {
const element = this.shadowRoot.querySelector('#card > *') as LovelaceCard;
if (element) {
console.log('computeCardSize is ' + computeCardSize(element));
return computeCardSize(element);
}
}

return 1;
}

protected render(): TemplateResult | void {
if (
!this._config ||
Expand Down Expand Up @@ -129,7 +133,9 @@ export class ConfigTemplateCard extends LitElement {
}

return html`
${element}
<div id="card">
${element}
</div>
`;
}

Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const CARD_VERSION = '1.3.5';
export const CARD_VERSION = '1.3.6';
8 changes: 6 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"target": "es2017",
"module": "esnext",
"moduleResolution": "node",
"lib": ["es2017", "dom", "dom.iterable"],
"lib": [
"es2017",
"dom",
"dom.iterable"
],
"noEmit": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
Expand All @@ -14,4 +18,4 @@
"resolveJsonModule": true,
"experimentalDecorators": true
}
}
}
Loading

0 comments on commit d7bedfe

Please sign in to comment.