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

Zone - Hass configuration name is optional #14449

Merged
merged 5 commits into from Jun 7, 2018

Conversation

Kane610
Copy link
Member

@Kane610 Kane610 commented May 13, 2018

Description:

Hass configuration option name is optional, make sure there is a name for the home zone

Related issue (if applicable): fixes #14396

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

@Kane610 Kane610 changed the title Hass configuration name is optional Zone - Hass configuration name is optional May 14, 2018
@Kane610 Kane610 changed the title Zone - Hass configuration name is optional WIP: Zone - Hass configuration name is optional May 16, 2018
@Kane610 Kane610 changed the title WIP: Zone - Hass configuration name is optional Zone - Hass configuration name is optional May 18, 2018

if HOME_ZONE not in hass.data[DOMAIN] and HOME_ZONE not in zone_entries:
name = hass.config.location_name
if name is None:
Copy link
Member

Choose a reason for hiding this comment

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

It's possible apply a proper default to location_name?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is hass own parameter. This is how the old logic worked. I just missed this use case

'latitude': 1.1,
'longitude': -2.2,
}
assert setup.setup_component(self.hass, zone.DOMAIN, {'zone': [info, info]})

Choose a reason for hiding this comment

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

line too long (84 > 79 characters)

@balloob balloob merged commit 0748466 into home-assistant:dev Jun 7, 2018
@ghost ghost removed the small-pr PRs with less than 30 lines. label Jun 7, 2018
@balloob balloob added this to the 0.71 milestone Jun 7, 2018
balloob pushed a commit that referenced this pull request Jun 8, 2018
* Hass configuration name is optional

* Check explicitly if name is none

* Reverted back to old logic for zones configured in configuration.yaml, where many zones can have the same name

* New test to verify use case of allowing multiple zones having the same name

* Fix too long line
@balloob balloob mentioned this pull request Jun 8, 2018
@Kane610 Kane610 deleted the zone-home-name-optional branch July 2, 2018 20:24
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
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.

Zone component error after update to 0.69
5 participants