Skip to content

Update item_activity_history_line.yaml - #5

Open
dapuzz wants to merge 1 commit into
kloggy:masterfrom
dapuzz:patch-2
Open

Update item_activity_history_line.yaml#5
dapuzz wants to merge 1 commit into
kloggy:masterfrom
dapuzz:patch-2

Conversation

@dapuzz

@dapuzz dapuzz commented Apr 7, 2020

Copy link
Copy Markdown
Contributor

undefined zone total time

undefined zone total time

@kloggy kloggy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for these changes. As I said in the readme I am not a Javascript programmer, I am learning as I go! How is your version better than mine? I don't doubt it, I just wondered?

@dapuzz

dapuzz commented Apr 8, 2020

Copy link
Copy Markdown
Contributor Author

I am not a js developer either :-D this just fix when you have less thatn 8 zones you get an "undefined" that breaks the script

@dapuzz dapuzz closed this Apr 8, 2020
@dapuzz

dapuzz commented Apr 8, 2020

Copy link
Copy Markdown
Contributor Author

Oops,I deleted the commit by mistake. Junior user of github too!

@dapuzz dapuzz reopened this Apr 8, 2020

@kloggy kloggy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see...
Maybe you you have solved a problem I was also having which I solved by changing this section to include an else.

styles:
  card:
    - display:
        [[[
          var zone = '{{ zone }}';
          zone = Number(zone.substring(4, 5));
          var number_of_zones = Number(states['input_number.irrigation_number_of_zones'].state);
          var show_history = states['input_boolean.irrigation_show_status_history'].state;
          if (zone > number_of_zones ||
              show_history == 'off' )
            return 'none';
          else return null;
        ]]]

But I too am junior with Github and I did it by editing the file directly.
Unless of course this is a different problem? But mine works with less than 8 zones.

I also added the else in item_activity_previous_line.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants