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

Add support for Ubiquiti mFi sensors and switches #1151

Merged
merged 2 commits into from
Feb 7, 2016

Conversation

kk7ds
Copy link
Contributor

@kk7ds kk7ds commented Feb 6, 2016

No description provided.

@balloobbot
Copy link

This is an automated response to help you succeed in getting this PR merged.

  • Whenever CI fails, the reason for failing will be at the bottom of the log. Each Python version performs different tests so it can be that only Python 3.5 fails. Your PR cannot be merged unless CI is green!
  • Always make sure your fork is up to date before you create a new branch. No "merge upstream" or "merge dev" commits. Also rebase on the dev branch before creating a PR.
  • Squash your commits when the PR is ready to be merged.

If your code communicates with devices:

  • Use a 3rd party library for communication. Add dependencies via REQUIREMENTS variable (example).
  • Only import your 3rd party dependencies inside functions that use it (example).
  • Run script/gen_requirements_all.py to update requirements_all.txt.
  • Add your new files to .coveragerc

If your code does not depend on external devices:

  • Write tests to verify your code works

port = int(config.get('port', 6443))
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)

Copy link
Member

Choose a reason for hiding this comment

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

Can you please check if the mandatory configuration parts are provided? If not, the setup should fail with a log entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, forgot to do this, will fix it up.

value = self._port.value
if self._port.tag == 'temperature':
temp_unit = self._hass.config.temperature_unit
if temp_unit.endswith('F'):
Copy link
Member

Choose a reason for hiding this comment

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

There is no need for this. Home Assistant will automatically convert temperature values to the user preferred temperature unit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, nifty, thanks.

This adds support for sensors based on Ubiquiti's mFi platform.
All ports/sensors are detected from the mFi controller and exposed.
This adds support for mFi devices that are swichable,
such as the mFi Outlet device.
balloob added a commit that referenced this pull request Feb 7, 2016
Add support for Ubiquiti mFi sensors and switches
@balloob balloob merged commit 428750e into home-assistant:dev Feb 7, 2016
@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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants