Skip to content

Commit

Permalink
Renames pick up variables to match component
Browse files Browse the repository at this point in the history
Renames pick up variables to match component
  • Loading branch information
Voxxie committed May 4, 2020
1 parent 22b4cd5 commit 7b7a6de
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,25 @@ Option | Values | Default | Details
-- | - | - | -
time_slots_delivery | `sensor` | | The sensor that contains the Jumbo deliverie timeslots, it not defined its not visible.
time_slots_delivery_days| `int` | `99` | Define of how many days of timeslots should be displayed.
time_slots_pickup | `sensor` | | The sensor that contains the Jumbo pickup timeslots, it not defined its not visible.
time_slots_pickup_days | `int` | `99` | Define of how many days of timeslots should be displayed.
time_slots_pick_up | `sensor` | | The sensor that contains the Jumbo pickup timeslots, it not defined its not visible.
time_slots_pick_up_days | `int` | `99` | Define of how many days of timeslots should be displayed.
deliveries | `sensor` | | The sensor that contains the Jumbo deliveries, it not defined its not visible.
pick_ups | `sensor` | | The sensor that contains the Jumbo pick ups, it not defined its not visible.
basket | `sensor` | | The sensor that contains the Jumbo basket, it not defined its not visible.


## Example config:

```type: 'custom:jumbo-card'
time_slots_delivery: sensor.jumbo_time_slots
time_slots_delivery: 2
deliveries: sensor.jumbo_orders
time_slots_delivery: sensor.jumbo_delivery_time_slots
time_slots_delivery_days: 2
time_slots_pick_up: sensor.jumbo_pick_up_time_slots
time_slots_pick_up_days: 2
deliveries: sensor.jumbo_delivery
pick_ups: sensor.jumbo_pick_up
basket: sensor.jumbo_basket
```
## Example image:
![Test Image 1](https://github.com/Voxxie/lovelace-jumbo-card/blob/master/images/Examplecard.png)
Expand Down
19 changes: 11 additions & 8 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,26 @@ Option | Values | Default | Details
-- | - | - | -
time_slots_delivery | `sensor` | | The sensor that contains the Jumbo deliverie timeslots, it not defined its not visible.
time_slots_delivery_days| `int` | `99` | Define of how many days of timeslots should be displayed.
time_slots_pickup | `sensor` | | The sensor that contains the Jumbo pickup timeslots, it not defined its not visible.
time_slots_pickup_days | `int` | `99` | Define of how many days of timeslots should be displayed.
time_slots_pick_up | `sensor` | | The sensor that contains the Jumbo pickup timeslots, it not defined its not visible.
time_slots_pick_up_days | `int` | `99` | Define of how many days of timeslots should be displayed.
deliveries | `sensor` | | The sensor that contains the Jumbo deliveries, it not defined its not visible.
pick_ups | `sensor` | | The sensor that contains the Jumbo pick ups, it not defined its not visible.
basket | `sensor` | | The sensor that contains the Jumbo basket, it not defined its not visible.



## Example config:

```title: Jumbo card
type: 'custom:jumbo-card'
timeslots_delivery: sensor.jumbo_time_slots
timeslots_delivery_days: 2
deliveries: sensor.jumbo_orders
```type: 'custom:jumbo-card'
time_slots_delivery: sensor.jumbo_delivery_time_slots
time_slots_delivery_days: 2
time_slots_pick_up: sensor.jumbo_pick_up_time_slots
time_slots_pick_up_days: 2
deliveries: sensor.jumbo_delivery
pick_ups: sensor.jumbo_pick_up
basket: sensor.jumbo_basket
```


## Example image:
![Test Image 1](https://github.com/Voxxie/lovelace-jumbo-card/blob/master/images/Examplecard.png)

Expand Down
10 changes: 5 additions & 5 deletions jumbo-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class JumboOverviewCard extends HTMLElement {
//Define show parameters, and set them to a value if nog defined.
const time_slots_delivery = this.config.time_slots_delivery ? this.config.time_slots_delivery : 'unknown'
const time_slots_delivery_days = this.config.time_slots_delivery_days ? this.config.time_slots_delivery_days : '99';
const time_slots_pickup = this.config.time_slots_pickup ? this.config.time_slots_pickup : 'unknown';
const time_slots_pickup_days = this.config.time_slots_pickup_days ? this.config.time_slots_pickup_days : '99';
const time_slots_pick_up = this.config.time_slots_pick_up ? this.config.time_slots_pick_up : 'unknown';
const time_slots_pick_up_days = this.config.time_slots_pick_up_days ? this.config.time_slots_pick_up_days : '99';
const deliveries = this.config.deliveries ? this.config.deliveries : 'unknown';
const basket = this.config.basket ? this.config.basket : 'unknown';

Expand Down Expand Up @@ -114,11 +114,11 @@ class JumboOverviewCard extends HTMLElement {
//START Loop timeslots_pickup


if (time_slots_pickup != 'unknown') {
if (time_slots_pick_up != 'unknown') {

output += `<h2>Beschikbare pickup momenten</h2>`;

const state = hass.states[time_slots_pickup];
const state = hass.states[time_slots_pick_up];
var cudate = `0000`;
var showtimeslot = 'yes';
var numdays = 0;
Expand All @@ -131,7 +131,7 @@ class JumboOverviewCard extends HTMLElement {

if (cudate != startdate ){

if (numdays < time_slots_pickup_days){
if (numdays < time_slots_pick_up_days){

if (cudate != `0000`){
output += `</div>`;
Expand Down

0 comments on commit 7b7a6de

Please sign in to comment.