Skip to content

Add support for Bosch BMP280 Sensor#30837

Merged
bdraco merged 8 commits into
home-assistant:devfrom
belidzs:bmp280
Mar 23, 2020
Merged

Add support for Bosch BMP280 Sensor#30837
bdraco merged 8 commits into
home-assistant:devfrom
belidzs:bmp280

Conversation

@belidzs
Copy link
Copy Markdown
Contributor

@belidzs belidzs commented Jan 16, 2020

Description:

Implement support for the Bosch BMP280 Environmental Sensor

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#11769

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: bmp280

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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

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

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @belidzs,

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!

@springstan springstan changed the title Implement support for Bosch BMP280 Sensor Add support for Bosch BMP280 Sensor Jan 16, 2020
@springstan
Copy link
Copy Markdown
Member

@belidzs please take a look at the pylint errors :)

@belidzs
Copy link
Copy Markdown
Contributor Author

belidzs commented Jan 16, 2020

@springstan my bad, I thought running tox -e lint would also run pylint. It comes back without errors now.

@belidzs
Copy link
Copy Markdown
Contributor Author

belidzs commented Jan 16, 2020

It looks like the build is failing because of an other component in the repo called rpi_gpio.

I have fetched the latest dev and rebased my branch on it to see if it's been fixed since, but the linter still fails:

root@88d1efd412a7:/workspaces/home-assistant# pylint homeassistant/components/rpi_gpio
************* Module homeassistant.components.rpi_gpio
homeassistant/components/rpi_gpio/__init__.py:18:8: E1101: Module 'RPi.GPIO' has no 'cleanup' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:25:4: E1101: Module 'RPi.GPIO' has no 'setmode' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:25:17: E1101: Module 'RPi.GPIO' has no 'BCM' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:31:4: E1101: Module 'RPi.GPIO' has no 'setup' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:31:21: E1101: Module 'RPi.GPIO' has no 'OUT' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:36:4: E1101: Module 'RPi.GPIO' has no 'setup' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:36:21: E1101: Module 'RPi.GPIO' has no 'IN' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:36:30: E1101: Module 'RPi.GPIO' has no 'PUD_DOWN' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:36:72: E1101: Module 'RPi.GPIO' has no 'PUD_UP' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:41:4: E1101: Module 'RPi.GPIO' has no 'output' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:46:11: E1101: Module 'RPi.GPIO' has no 'input' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:51:4: E1101: Module 'RPi.GPIO' has no 'add_event_detect' member (no-member)
homeassistant/components/rpi_gpio/__init__.py:51:32: E1101: Module 'RPi.GPIO' has no 'BOTH' member (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.

Why does this integration needs RPi.GPIO?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

adafruit-circuitpython-bmp280 depends on Adafruit-Blinka while it conditionally depends on RPi.GPIO (on arm architecture anyway)

I wasn't sure if these conditional requirements will be automatically resolved by home-assistant but a tutorial written by the library author explicitly mentioned it as a requirement so I added it to the requirements as well.

As it is commented out by gen_requirements_all.py anyways I think it can be safely removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@fabaff is this blocking the merge?

Comment thread homeassistant/components/bmp280/manifest.json Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
@belidzs
Copy link
Copy Markdown
Contributor Author

belidzs commented Mar 12, 2020

Is there anything I need to do at this point?

Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
Comment thread homeassistant/components/bmp280/sensor.py Outdated
@belidzs belidzs requested a review from bdraco March 21, 2020 15:12
Comment thread homeassistant/components/bmp280/sensor.py
Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

This is getting close. Are the docs still accurate?

@belidzs
Copy link
Copy Markdown
Contributor Author

belidzs commented Mar 21, 2020

@bdraco not really, I have to update it due to the fact that the i2c_address parameter became required and there's no default value provided anymore. I'll do that soon as well.

@belidzs belidzs requested a review from bdraco March 21, 2020 17:25
@belidzs
Copy link
Copy Markdown
Contributor Author

belidzs commented Mar 21, 2020

Fixed docs as well at #11769

Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

LGTM

@belidzs
Copy link
Copy Markdown
Contributor Author

belidzs commented Mar 21, 2020

@bdraco thanks for the review, I appreciate it

@bdraco bdraco merged commit df67ab9 into home-assistant:dev Mar 23, 2020
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Mostly small things. Please address the comments in a new PR.

Comment thread homeassistant/components/bmp280/sensor.py
Comment thread homeassistant/components/bmp280/sensor.py
Comment thread homeassistant/components/bmp280/sensor.py
Comment thread homeassistant/components/bmp280/sensor.py
@belidzs belidzs deleted the bmp280 branch March 24, 2020 14:05
MartinHjelmare added a commit that referenced this pull request Mar 24, 2020
* Fix minor issues mentioned in #30837 after it was closed

* Update homeassistant/components/bmp280/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@lock lock Bot locked and limited conversation to collaborators Mar 27, 2020
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.

6 participants