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 Pilight switch #3819

Merged
merged 3 commits into from
Oct 31, 2016
Merged

Use voluptuous for Pilight switch #3819

merged 3 commits into from
Oct 31, 2016

Conversation

fabaff
Copy link
Member

@fabaff fabaff commented Oct 11, 2016

Description:
Migration of the configuration check to voluptuous.

Related issue (if applicable): fixes 127528299

Example entry for configuration.yaml (if applicable):

switch:
  - platform: pilight
    switches:
      Bed light:
        on_code:
          protocol: intertechno_old
          unit: 3
          id: 4
          'on': 1
        off_code:
          protocol: intertechno_old
          unit: 3
          id: 4
          'off': 1
        on_code_receive:
          protocol: daycom
          systemcode: 14462
          unit: 6
          id: 34
          state: 'on'
        off_code_receive:
          protocol: daycom
          systemcode: 14462
          unit: 6
          id: 34
          state: 'off'

@mention-bot
Copy link

@fabaff, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DavidLP, @daBONDi and @robbiet480 to be potential reviewers.

import homeassistant.components.pilight as pilight
from homeassistant.components.switch import SwitchDevice
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (

Choose a reason for hiding this comment

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

farcy v1.1

  • 1: F401 'CONF_PROTOCOL' imported but unused

@fabaff fabaff mentioned this pull request Oct 11, 2016
'uuid': data['uuid']},
**data['message'])
data = dict({'protocol': data['protocol'], 'uuid': data['uuid']},
**data['message'])
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized that this part of code uses PEP448,thus is not python 3.4 compatible. I have to fix that.

@daBONDi
Copy link
Contributor

daBONDi commented Oct 11, 2016

@mention-bot
The only thing i use for my KNX Stuff was CONF_MAXIMUM in homeassistant/const.py
put it was removed and added again on the commit so it should be ok for me

vol.Optional(CONF_SYSTEMCODE): cv.string,
})

SWITCHES_SCHEMA = vol.Schema({
Copy link
Member

Choose a reason for hiding this comment

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

You're missing CONF_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.

Thanks.

@balloob balloob self-assigned this Oct 15, 2016

_LOGGER = logging.getLogger(__name__)

CONF_OFF_CODE = 'off_code'
CONF_OFF_CODE = 'off_code'
Copy link
Member Author

Choose a reason for hiding this comment

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

Duplicates...

@DavidLP
Copy link
Contributor

DavidLP commented Oct 16, 2016

Is there a way that I can add code to this PR, or do I have to create my own PR? I tried to Google this basic question but no luck...

@balloob
Copy link
Member

balloob commented Oct 16, 2016

@DavidLP to add code to this PR, branch off @fabaff branch and open a PR against his branch on his repo.

@fabaff
Copy link
Member Author

fabaff commented Oct 18, 2016

If it's not voluptuous-related then it would be probably easier and more transparent (due to squash) to create a new PR after that one is merged.

@fabaff
Copy link
Member Author

fabaff commented Oct 30, 2016

Time to finish #2800 ...

@fabaff
Copy link
Member Author

fabaff commented Oct 30, 2016

Ups, sorry committed to wrong branch.

@fabaff
Copy link
Member Author

fabaff commented Oct 31, 2016

I'm going to merge this and take the heat.

@fabaff fabaff merged commit 4484a7a into home-assistant:dev Oct 31, 2016
@fabaff fabaff deleted the voluptuous-pilight-switch branch October 31, 2016 12:18
@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.

7 participants