Skip to content

Initial support for Fibaro HomeCenter hubs#17891

Merged
MartinHjelmare merged 30 commits intohome-assistant:devfrom
pbalogh77:dev
Nov 14, 2018
Merged

Initial support for Fibaro HomeCenter hubs#17891
MartinHjelmare merged 30 commits intohome-assistant:devfrom
pbalogh77:dev

Conversation

@pbalogh77
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown

@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
Copy Markdown

@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
Copy Markdown

@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
Copy Markdown
Member

frenck commented Oct 29, 2018

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

Copy link
Copy Markdown

@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
Copy Markdown
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.

Comment thread homeassistant/components/fibaro.py Outdated
Copy link
Copy Markdown

@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
Copy Markdown
Contributor Author

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

Comment thread homeassistant/components/sensor/fibaro.py Outdated
Comment thread homeassistant/components/light/fibaro.py Outdated
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
Copy Markdown
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
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Copy link
Copy Markdown
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.

Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/binary_sensor/fibaro.py Outdated
Fixes based on code review
Implemented stopping of StateHandler thread
Cleanup for clarity
Removed unnecessary list copying
Comment thread homeassistant/components/fibaro.py Outdated
Copy link
Copy Markdown
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.

Comment thread homeassistant/components/binary_sensor/fibaro.py
Comment thread homeassistant/components/binary_sensor/fibaro.py Outdated
Comment thread homeassistant/components/binary_sensor/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
Comment thread homeassistant/components/fibaro.py Outdated
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.

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
Copy Markdown
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.

8 participants