Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZWave Panel Updates #1647

Merged
merged 7 commits into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/panels/config/zwave/ha-config-zwave.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import './zwave-groups.js';
import './zwave-log.js';
import './zwave-network.js';
import './zwave-node-config.js';
import './zwave-node-information.js';
import './zwave-usercodes.js';
import './zwave-values.js';
import './zwave-node-protection.js';
Expand Down Expand Up @@ -203,13 +202,14 @@ class HaConfigZwave extends LocalizeMixin(PolymerElement) {
service="test_node"
hidden$="[[!showHelp]]">
</ha-service-description>
<paper-button on-click="nodeMoreInfo">Node Information</paper-button>
</div>

<div class="device-picker">
<paper-dropdown-menu label="Entities of this node" dynamic-align="" class="flex">
<paper-listbox slot="dropdown-content" selected="{{selectedEntity}}">
<template is="dom-repeat" items="[[entities]]" as="state">
<paper-item>[[computeSelectCaptionEnt(state)]]</paper-item>
<paper-item>[[state.entity_id]]</paper-item>
</template>
</paper-listbox>
</paper-dropdown-menu>
Expand Down Expand Up @@ -269,12 +269,6 @@ class HaConfigZwave extends LocalizeMixin(PolymerElement) {
</paper-card>

<template is="dom-if" if="[[computeIsNodeSelected(selectedNode)]]">
<!--Node info card-->
<zwave-node-information
id="zwave-node-information"
nodes="[[nodes]]"
selected-node="[[selectedNode]]"
></zwave-node-information>

<!--Value card-->
<zwave-values
Expand Down Expand Up @@ -563,6 +557,11 @@ class HaConfigZwave extends LocalizeMixin(PolymerElement) {
};
}

nodeMoreInfo(ev) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you prefix private methods with _

ev.preventDefault();
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that this is necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

I originally copied from the more-info code in dev-states, but tested it without this line and it looks like it still works, so I'll remove it.

this.fire('hass-more-info', { entityId: this.nodes[this.selectedNode].entity_id });
Copy link
Member

Choose a reason for hiding this comment

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

You'll need to include the EventsMixin to get this.fire

}

_saveEntity() {
const data = {
ignored: this.entityIgnored,
Expand Down
24 changes: 14 additions & 10 deletions src/panels/config/zwave/zwave-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,24 @@ class OzwLog extends PolymerElement {
padding-right: 24px;
padding-bottom: 24px;
}

.help-text {
padding: 5px 24px;
}
</style>
<ha-config-section is-wide="[[isWide]]">
<span slot="header">OZW Log</span>
<paper-card>
<div class="device-picker">
<paper-input label="Number of last log lines." type="number" min="0" max="1000" step="10" value="{{numLogLines}}">
</paper-input>
</div>
<div class="card-actions">
<paper-button raised="" on-click="refreshLog">Refresh</paper-button>
</div>
<div class="help-text">
<pre>[[ozwLogs]]</pre>
</div>
<div class="device-picker">
<paper-input label="Number of last log lines." type="number" min="0" max="1000" step="10" value="{{numLogLines}}">
</paper-input>
</div>
<div class="card-actions">
<paper-button raised="" on-click="refreshLog">Refresh</paper-button>
</div>
<div class="help-text">
<pre>[[ozwLogs]]</pre>
</div>
</paper-card>
</ha-config-section>
`;
Expand Down
74 changes: 0 additions & 74 deletions src/panels/config/zwave/zwave-node-information.js

This file was deleted.