Skip to content

Add area picker#4608

Merged
bramkragten merged 3 commits into
devfrom
area-picker
Jan 26, 2020
Merged

Add area picker#4608
bramkragten merged 3 commits into
devfrom
area-picker

Conversation

@bramkragten
Copy link
Copy Markdown
Member

@bramkragten bramkragten commented Jan 25, 2020

Proposed change

image

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Comment thread src/components/ha-area-picker.ts Outdated
private _areaChanged(ev: PolymerChangedEvent<string>) {
const newValue = ev.detail.value;

if (newValue === "add_new") {
Copy link
Copy Markdown
Member

@balloob balloob Jan 25, 2020

Choose a reason for hiding this comment

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

FYI, if you have a large IF-block at which you return at the end, and then have a small if-block, you can better reverse them and then have less indentation. Easier to follow.

    if (newValue !== "add_new") {
        if (newValue !== this._value) {
          this._setValue(newValue);
        }
        return;
    }

css`
ha-paper-dialog {
max-width: 500px;
max-width: 600px;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know why you did this, but I think for a future PR we should just convert the grid to a single list. Left side name/manufactuer/model, right side area. I'll open an issue for it.

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

Awesome !

@bramkragten bramkragten merged commit c7b3a51 into dev Jan 26, 2020
@delete-merged-branch delete-merged-branch Bot deleted the area-picker branch January 26, 2020 20:41
@lock lock Bot locked and limited conversation to collaborators Jan 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow creating an area from the area dropdown picker

3 participants