This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
757 additions
and
563 deletions.
There are no files selected for viewing
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,12 @@ | ||
{ | ||
"env": { | ||
"es6": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 10, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/node_modules/ | ||
/dist/ | ||
package-lock.json |
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,34 @@ | ||
{ | ||
"name": "weather-chart-card", | ||
"version": "1.0.0", | ||
"description": "Weather card with charts for Home Assistant Lovelace UI", | ||
"keywords": [ | ||
"home-assistant", | ||
"homeassistant", | ||
"hass", | ||
"automation", | ||
"lovelace", | ||
"custom-cards" | ||
], | ||
"module": "src/main.js", | ||
"repository": "git@github.com:Yevgenium/lovelace-weather-card-chart.git", | ||
"author": "Yevgeniy Prokopenko", | ||
"license": "MIT", | ||
"dependencies": { | ||
"chart.js": "^3.5.1", | ||
"chartjs-plugin-datalabels": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^5.16.0", | ||
"acorn": "^8.4.1", | ||
"rollup": "^2.33.1", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-serve": "^1.1.0" | ||
}, | ||
"scripts": { | ||
"start": "rollup -c rollup.config.dev.js --watch", | ||
"build": "npm run lint && npm run rollup", | ||
"lint": "eslint src/* --ext .js", | ||
"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,28 @@ | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import serve from 'rollup-plugin-serve'; | ||
|
||
const dev = process.env.ROLLUP_WATCH; | ||
|
||
const serveopts = { | ||
contentBase: ['./dist'], | ||
host: '0.0.0.0', | ||
port: 5000, | ||
allowCrossOrigin: true, | ||
headers: { | ||
'Access-Control-Allow-Origin': '*', | ||
}, | ||
}; | ||
|
||
export default { | ||
input: 'src/main.js', | ||
output: { | ||
file: 'dist/weather-chart-card-bundle.js', | ||
format: 'umd', | ||
name: 'WeatherChartCard', | ||
sourcemap: dev ? true : false, | ||
}, | ||
plugins: [ | ||
resolve(), | ||
dev && serve(serveopts), | ||
], | ||
}; |
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,52 @@ | ||
const cardinalDirectionsIcon = [ | ||
'arrow-down', 'arrow-bottom-left', 'arrow-left', | ||
'arrow-top-left', 'arrow-up', 'arrow-top-right', | ||
'arrow-right', 'arrow-bottom-right', 'arrow-down' | ||
]; | ||
|
||
const weatherIcons = { | ||
'clear-night': 'hass:weather-night', | ||
'cloudy': 'hass:weather-cloudy', | ||
'fog': 'hass:weather-fog', | ||
'hail': 'hass:weather-hail', | ||
'lightning': 'hass:weather-lightning', | ||
'lightning-rainy': 'hass:weather-lightning-rainy', | ||
'partlycloudy': 'hass:weather-partly-cloudy', | ||
'pouring': 'hass:weather-pouring', | ||
'rainy': 'hass:weather-rainy', | ||
'snowy': 'hass:weather-snowy', | ||
'snowy-rainy': 'hass:weather-snowy-rainy', | ||
'sunny': 'hass:weather-sunny', | ||
'windy': 'hass:weather-windy', | ||
'windy-variant': 'hass:weather-windy-variant' | ||
}; | ||
|
||
const weatherIconsDay = { | ||
'clear-night': 'clear-night', | ||
'cloudy': 'cloudy', | ||
'fog': 'fog', | ||
'hail': 'hail', | ||
'lightning': 'lightning', | ||
'lightning-rainy': 'lightning-rain', | ||
'partlycloudy': 'partlycloudy-day', | ||
'pouring': 'pouring', | ||
'rainy': 'rain', | ||
'snowy': 'snow', | ||
'snowy-rainy': 'sleet', | ||
'sunny': 'clear-day', | ||
'windy': 'wind', | ||
'windy-variant': 'wind', | ||
}; | ||
|
||
const weatherIconsNight = { | ||
...weatherIconsDay, | ||
'sunny': 'clear-night', | ||
'partlycloudy': 'partlycloudy-night', | ||
}; | ||
|
||
export { | ||
cardinalDirectionsIcon, | ||
weatherIcons, | ||
weatherIconsDay, | ||
weatherIconsNight | ||
}; |
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,56 @@ | ||
const locale = { | ||
en: { | ||
tempHi: 'Temperature', | ||
tempLo: 'Temperature night', | ||
precip: 'Precipitations', | ||
uPress: 'hPa', | ||
uSpeed: 'm/s', | ||
uPrecip: ['mm', 'in'], | ||
cardinalDirections: [ | ||
'N', 'N-NE', 'NE', 'E-NE', 'E', 'E-SE', 'SE', 'S-SE', | ||
'S', 'S-SW', 'SW', 'W-SW', 'W', 'W-NW', 'NW', 'N-NW', 'N' | ||
], | ||
'clear-night': 'Clear, night', | ||
'cloudy': 'Cloudy', | ||
'fog': 'Fog', | ||
'hail': 'Hail', | ||
'lightning': 'Lightning', | ||
'lightning-rainy': 'Lightning, rainy', | ||
'partlycloudy': 'Partly cloudy', | ||
'pouring': 'Pouring', | ||
'rainy': 'Rainy', | ||
'snowy': 'Snowy', | ||
'snowy-rainy': 'Snowy, rainy', | ||
'sunny': 'Sunny', | ||
'windy': 'Windy', | ||
'windy-variant': 'Windy' | ||
}, | ||
ru: { | ||
tempHi: 'Температура', | ||
tempLo: 'Температура ночью', | ||
precip: 'Осадки', | ||
uPress: 'гПа', | ||
uSpeed: 'м/с', | ||
uPrecip: ['мм', 'дюйма'], | ||
cardinalDirections: [ | ||
'С', 'С-СВ', 'СВ', 'В-СВ', 'В', 'В-ЮВ', 'ЮВ', 'Ю-ЮВ', | ||
'Ю', 'Ю-ЮЗ', 'ЮЗ', 'З-ЮЗ', 'З', 'З-СЗ', 'СЗ', 'С-СЗ', 'С' | ||
], | ||
'clear-night': 'Ясно', | ||
'cloudy': 'Облачно', | ||
'fog': 'Туман', | ||
'hail': 'Град', | ||
'lightning': 'Гроза', | ||
'lightning-rainy': 'Дождь с грозой', | ||
'partlycloudy': 'Переменная облачность', | ||
'pouring': 'Ливень', | ||
'rainy': 'Дождь', | ||
'snowy': 'Снег', | ||
'snowy-rainy': 'Снег с дождем', | ||
'sunny': 'Ясно', | ||
'windy': 'Ветрено', | ||
'windy-variant': 'Ветрено' | ||
} | ||
}; | ||
|
||
export default locale; |
Oops, something went wrong.