Skip to content

Support for the PiFace Digital I/O module#7494

Merged
balloob merged 4 commits into
home-assistant:devfrom
basschipper:pfio
May 10, 2017
Merged

Support for the PiFace Digital I/O module#7494
balloob merged 4 commits into
home-assistant:devfrom
basschipper:pfio

Conversation

@basschipper
Copy link
Copy Markdown
Contributor

@basschipper basschipper commented May 8, 2017

Description:

Support for the PiFace Digital I/O module (Raspberry Pi add on board)
This is basically a port of the rpi_gpio component.

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2597

Example entry for configuration.yaml (if applicable):

binary_sensor:
  - platform: rpi_pfio
    ports:
      0:
        name: Motion sensor
      1:
        name: Doorbell
        invert_logic: true

Checklist:

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

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @basschipper,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@mention-bot
Copy link
Copy Markdown

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

Comment thread homeassistant/components/rpi_pfio.py Outdated
"""Activate the registered listener events."""
# pylint: disable=global-variable-not-assigned
global LISTENER
LISTENER.activate() No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

no newline at end of file

pvizeli
pvizeli previously requested changes May 9, 2017
Comment thread homeassistant/components/rpi_pfio.py Outdated
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/rpi_pfio/
"""
# pylint: disable=import-error
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.

Remove this

Comment thread homeassistant/components/rpi_pfio.py Outdated
LISTENER = None


# pylint: disable=no-member
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.

Remove this

Comment thread homeassistant/components/rpi_pfio.py Outdated

DOMAIN = 'rpi_pfio'

LISTENER = None
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.

Don't use global variable. Use hass.data.
Like:

DATA_PIFACE = 'piface'
...
hass.data[DATA_PIFACE] = xy

})


# pylint: disable=unused-argument
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.

Should not needed

self._name = name or DEVICE_DEFAULT_NAME
self._invert_logic = invert_logic
self._state = False
# rpi_pfio.setup_output(self._port)
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.

remove this

@balloob balloob dismissed pvizeli’s stale review May 10, 2017 05:36

concern addressed

@balloob balloob merged commit 85e71fc into home-assistant:dev May 10, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Aug 12, 2017
@basschipper basschipper deleted the pfio branch February 28, 2018 20:04
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