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

Use voluptuous for x10 #3342

Merged
merged 1 commit into from
Sep 21, 2016
Merged

Use voluptuous for x10 #3342

merged 1 commit into from
Sep 21, 2016

Conversation

fabaff
Copy link
Member

@fabaff fabaff commented Sep 12, 2016

Description:
Migration of the configuration check to voluptuous.

Related issue (if applicable): fixes 127528299

Example entry for configuration.yaml (if applicable):

light:
  - platform: x10
    lights:
      - name: Living Room Lamp
        id: a2
      - name: Bedroom Lamp
        id: a3

@fotoetienne, would be nice if you could take a look at the changes and run a quick test. Thanks.

@fabaff fabaff mentioned this pull request Sep 12, 2016
vol.Required(CONF_LIGHTS): vol.All(cv.ensure_list, [
{
vol.Required(CONF_ID): cv.string,
vol.Optional(CONF_NAME): cv.string,
Copy link
Member

Choose a reason for hiding this comment

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

Code assumes that name is required.

Copy link
Member Author

Choose a reason for hiding this comment

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

True


_LOGGER = logging.getLogger(__name__)

SUPPORT_X10 = SUPPORT_BRIGHTNESS

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_LIGHTS): vol.All(cv.ensure_list, [
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to move this to CONF_DEVICES ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we are using CONF_DEVICES already at other places.

@balloob
Copy link
Member

balloob commented Sep 21, 2016

Looks good! 🐬

@balloob balloob merged commit 0335f88 into home-assistant:dev Sep 21, 2016
@fabaff fabaff deleted the voluptuous-x10 branch September 26, 2016 20:06
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
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.

2 participants