Skip to content

Commit

Permalink
Removed possible fix for #64.
Browse files Browse the repository at this point in the history
  • Loading branch information
gurbyz committed Oct 25, 2020
1 parent c6b2369 commit 835ec4c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Changelog
====
## 0.1.5-dev
### Fixes
* Trying to solve #64. Could it be caused by lazy loading in HA?

## 0.1.4
### Improvements
Expand Down
29 changes: 14 additions & 15 deletions power-wheel-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,21 +629,20 @@ class PowerWheelCard extends LitElement {

setConfig(config) {
config = { ...config };
// Disabled as part of testing for issue #64: could lazy loading of HA be the cause?
// if (!config.solar_power_entity) {
// throw new Error('You need to define a solar_power_entity');
// }
// if (!config.grid_power_consumption_entity && !config.grid_power_production_entity
// && !config.grid_power_entity) {
// throw new Error('You need to define a grid_power_consumption_entity' +
// 'and a grid_power_production_entity OR you can define a grid_power_entity');
// }
// if (config.grid_power_production_entity && !config.grid_power_consumption_entity) {
// throw new Error('You need to define a grid_power_consumption_entity');
// }
// if (config.grid_power_consumption_entity && !config.grid_power_production_entity) {
// throw new Error('You need to define a grid_power_production_entity');
// }
if (!config.solar_power_entity) {
throw new Error('You need to define a solar_power_entity');
}
if (!config.grid_power_consumption_entity && !config.grid_power_production_entity
&& !config.grid_power_entity) {
throw new Error('You need to define a grid_power_consumption_entity' +
'and a grid_power_production_entity OR you can define a grid_power_entity');
}
if (config.grid_power_production_entity && !config.grid_power_consumption_entity) {
throw new Error('You need to define a grid_power_consumption_entity');
}
if (config.grid_power_consumption_entity && !config.grid_power_production_entity) {
throw new Error('You need to define a grid_power_production_entity');
}
config.charging_is_positive = config.charging_is_positive !== false;
config.charging_is_positive = config.charging_is_positive ? 1 : -1;
config.production_is_positive = config.production_is_positive !== false;
Expand Down
6 changes: 0 additions & 6 deletions preload-cards.js

This file was deleted.

0 comments on commit 835ec4c

Please sign in to comment.