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

Initial support for Fibaro HomeCenter hubs #17891

Merged
merged 30 commits into from
Nov 14, 2018

Conversation

pbalogh77
Copy link
Contributor

@pbalogh77 pbalogh77 commented Oct 27, 2018

Description:

Added Fibaro component to integrate with Fibaro Home Center, using an adapted version of the Fiblary library and the Fibaro REST API.
What works:

  • Lights, Switches, Sensors, Covers, Binary sensors
  • Connection, updates, interaction

What's not working yet:

  • Virtual devices, Scenes, Panels, Locks, etc

Related issue (if applicable): fixes #

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

Example entry for configuration.yaml (if applicable):

fibaro:
    url: "http://yourfibarohc/api/"
    username: "your@superuseremail.com"
    password: "YourPassword1"

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

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

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

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated 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:

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

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

@frenck
Copy link
Member

frenck commented Oct 29, 2018

Could not find a related PR in our documentation repository. Adding docs-missing label.

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

@pbalogh77
Copy link
Contributor Author

Could someone please help me understand what I'm doing wrong here? I keep getting the this error from lint: https://travis-ci.org/home-assistant/home-assistant/jobs/447813324
fiblary3 is listed as a requirement, it's in requirements_all.txt and all works fine locally, even the req validate script.

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

@pbalogh77
Copy link
Contributor Author

What does the coverage/coveralls error mean and what can I do about it? My component is listed in .coveragerc omit section.

Very first steps working, connects, fetches devices, represents sensors, binary_sensors and lights towards HA.
Initial support for covers
Initial support for switches
Bugfixes
pylint based cleanup
light switches handled properly
light features reported correctly
Lights, Blinds, Switches are mostly working now
Fiblary3 is now in pypi, set it as req
Cleanup based on pylint
Included the fibaro component in coveragerc
Added usage instructions to file header
Fixed pylint warnings
PyLint inspired fixes
Missing comment added to please flake8
@pbalogh77
Copy link
Contributor Author

Could someone please take a look at the error message here? I don't think it's related to my code in any way.

Stripdown, hoping for a review
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
Copy link
Contributor

@amelchio amelchio left a comment

Choose a reason for hiding this comment

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

This already looks good to me. I have a bunch of small questions/proposals but I did not find any major issues.

homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/binary_sensor/fibaro.py Outdated Show resolved Hide resolved
Fixes based on code review
Implemented stopping of StateHandler thread
Cleanup for clarity
Removed unnecessary list copying
Copy link
Contributor

@amelchio amelchio left a comment

Choose a reason for hiding this comment

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

Great, I think we can go with this.

homeassistant/components/binary_sensor/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/binary_sensor/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
homeassistant/components/fibaro.py Outdated Show resolved Hide resolved
Copy link
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.

Looks good! Can be merged when build passes.

@MartinHjelmare MartinHjelmare merged commit 3128729 into home-assistant:dev Nov 14, 2018
@ghost ghost removed the in progress label Nov 14, 2018
@amelchio
Copy link
Contributor

This was an awesome first contribution. The code is high quality and your response to feedback is exemplary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants