forked from bobzer/weather-card
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update card to work with 2024.4.0+ (#5)
- Loading branch information
Showing
20 changed files
with
3,620 additions
and
3,951 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Prettify files | ||
de88fc6b1f563a1359d4a81b6d5a1de9295d9502 |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @ts-check | ||
|
||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
import lisPlugin from 'eslint-plugin-lit'; | ||
import litA11yPlugin from 'eslint-plugin-lit-a11y'; | ||
|
||
export default tseslint.config( | ||
{ | ||
ignores: ['dist/**/*'], | ||
}, | ||
eslint.configs.recommended, | ||
eslintPluginPrettierRecommended, | ||
...tseslint.configs.recommended, | ||
...tseslint.configs.stylistic, | ||
{ | ||
plugins: { lit: lisPlugin }, | ||
rules: { | ||
...lisPlugin.configs.all.rules, | ||
}, | ||
}, | ||
{ | ||
plugins: { 'lit-a11y': litA11yPlugin }, | ||
rules: { | ||
...litA11yPlugin.configs.recommended.rules, | ||
}, | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{ | ||
"name": "Lovelace animated weather card", | ||
"filename": "weather-card.js" | ||
"filename": "weather-card.js", | ||
"hacs": "1.2.0", | ||
"homeassistant": " 2024.4.0", | ||
"render_readme": true, | ||
"hide_default_branch": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "weather-card", | ||
"version": "1.7.2", | ||
"version": "1.8.0", | ||
"description": "Lovelace animated weather card", | ||
"keywords": [ | ||
"home-assistant", | ||
|
@@ -14,41 +14,48 @@ | |
"repository": "[email protected]:MarcHagen/weather-card.git", | ||
"author": "Marc Hagen <[email protected]>", | ||
"license": "MIT", | ||
"type": "module", | ||
"dependencies": { | ||
"custom-card-helpers": "^1.7.0", | ||
"home-assistant-js-websocket": "^5.10.0", | ||
"lit-element": "^2.5.1", | ||
"lit-html": "^1.4.1" | ||
"custom-card-helpers": "1.9.0", | ||
"home-assistant-js-websocket": "9.3.0", | ||
"lit": "2.8.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.12.3", | ||
"@babel/plugin-proposal-class-properties": "^7.12.1", | ||
"@babel/plugin-proposal-decorators": "^7.12.1", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@typescript-eslint/eslint-plugin": "^2.34.0", | ||
"@typescript-eslint/parser": "^2.34.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-json": "^3.0.0", | ||
"prettier": "^1.19.1", | ||
"rollup": "^1.32.1", | ||
"@babel/core": "^7.24.7", | ||
"@babel/plugin-proposal-decorators": "^7.24.7", | ||
"@babel/plugin-transform-class-properties": "^7.24.7", | ||
"@eslint/js": "^9.4.0", | ||
"@rollup/plugin-json": "^6.1.0", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/node": ">=20", | ||
"eslint": "^9.4.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-json": "^4.0.0", | ||
"eslint-plugin-lit": "^1.14.0", | ||
"eslint-plugin-lit-a11y": "^4.1.2", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"node": ">=20", | ||
"prettier": "^3.3.1", | ||
"rollup": "^4.18.0", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-serve": "^1.1.0", | ||
"rollup-plugin-terser": "^5.3.1", | ||
"rollup-plugin-typescript2": "^0.24.3", | ||
"rollup-plugin-serve": "^1.1.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-typescript2": "^0.36.0", | ||
"rollup-plugin-uglify": "^6.0.4", | ||
"rollup-plugin-json": "^4.0.0", | ||
"typescript": "^3.9.7" | ||
"ts-node": "^10.9.2", | ||
"ts-lit-plugin": "^2.0.2", | ||
"typescript": "^5.4.5", | ||
"typescript-eslint": "^7.12.0" | ||
}, | ||
"scripts": { | ||
"start": "rollup -c --watch", | ||
"build": "npm run lint && npm run rollup", | ||
"lint": "eslint src/*.ts", | ||
"lint": "eslint", | ||
"rollup": "rollup -c" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const config = { | ||
semi: true, | ||
trailingComma: 'all', | ||
singleQuote: true, | ||
printWidth: 120, | ||
tabWidth: 2, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,40 @@ | ||
export const DAY_IN_MILLISECONDS = 86400000; | ||
export const UPDATE_PROPS = ['entity', 'config']; | ||
|
||
export const cardinalDirectionsIcon = [ | ||
'mdi:arrow-down', 'mdi:arrow-bottom-left', 'mdi:arrow-left', | ||
'mdi:arrow-top-left', 'mdi:arrow-up', 'mdi:arrow-top-right', | ||
'mdi:arrow-right', 'mdi:arrow-bottom-right', 'mdi:arrow-down' | ||
'mdi:arrow-down', | ||
'mdi:arrow-bottom-left', | ||
'mdi:arrow-left', | ||
'mdi:arrow-top-left', | ||
'mdi:arrow-up', | ||
'mdi:arrow-top-right', | ||
'mdi:arrow-right', | ||
'mdi:arrow-bottom-right', | ||
'mdi:arrow-down', | ||
]; | ||
|
||
export const weatherIconsDay = { | ||
clear: "day", | ||
"clear-night": "night", | ||
cloudy: "cloudy", | ||
fog: "cloudy", | ||
hail: "rainy-7", | ||
lightning: "thunder", | ||
"lightning-rainy": "thunder", | ||
partlycloudy: "cloudy-day-3", | ||
pouring: "rainy-6", | ||
rainy: "rainy-5", | ||
snowy: "snowy-6", | ||
"snowy-rainy": "rainy-7", | ||
sunny: "day", | ||
windy: "cloudy", | ||
"windy-variant": "cloudy-day-3", | ||
exceptional: "!!" | ||
clear: 'day', | ||
'clear-night': 'night', | ||
cloudy: 'cloudy', | ||
fog: 'cloudy', | ||
hail: 'rainy-7', | ||
lightning: 'thunder', | ||
'lightning-rainy': 'thunder', | ||
partlycloudy: 'cloudy-day-3', | ||
pouring: 'rainy-6', | ||
rainy: 'rainy-5', | ||
snowy: 'snowy-6', | ||
'snowy-rainy': 'rainy-7', | ||
sunny: 'day', | ||
windy: 'cloudy', | ||
'windy-variant': 'cloudy-day-3', | ||
exceptional: '!!', | ||
}; | ||
|
||
export const weatherIconsNight = { | ||
...weatherIconsDay, | ||
clear: "night", | ||
sunny: "night", | ||
partlycloudy: "cloudy-night-3", | ||
"windy-variant": "cloudy-night-3" | ||
...weatherIconsDay, | ||
clear: 'night', | ||
sunny: 'night', | ||
partlycloudy: 'cloudy-night-3', | ||
'windy-variant': 'cloudy-night-3', | ||
}; | ||
|
||
export const stopPropagation = (ev: { stopPropagation: () => unknown }) => ev.stopPropagation(); |
Oops, something went wrong.