Skip to content

Samsung Family hub camera component#14458

Merged
fabaff merged 10 commits into
home-assistant:devfrom
Klathmon:family-hub-camera
May 14, 2018
Merged

Samsung Family hub camera component#14458
fabaff merged 10 commits into
home-assistant:devfrom
Klathmon:family-hub-camera

Conversation

@Klathmon
Copy link
Copy Markdown
Contributor

@Klathmon Klathmon commented May 14, 2018

Description:

Family Hub camera for Samsung Refrigerators.

Related issue (if applicable):

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

Example entry for configuration.yaml (if applicable):

# Example configuration.yaml entry
camera:
  - platform: familyhub
    address: 'IP_ADDRESS'

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




class FamilyHubCamera(Camera):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

too many blank lines (3)

vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})

async def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

expected 2 blank lines, found 1
line too long (85 > 79 characters)


REQUIREMENTS = ['pyfamilyhublocal==0.0.2']

CONF_IP = 'address'
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.

We have CONF_IP_ADDRESS in const.py. Please use that.

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.

Got it, and i'm updating the docs now

@Klathmon
Copy link
Copy Markdown
Contributor Author

Klathmon commented May 14, 2018

I ran the script/gen_requirements_all.py on my branch as an attempt to fix the travis failure, however it seemed to just remove the pyfamilyhublocal entirely, and it changed a lot of other lines. I'm not 100% on how all of this fits together at this point still so just point me to the right docs if i'm doing something horribly wrong.

Edit: Just figured out what I did wrong, fixing it now...

@Klathmon
Copy link
Copy Markdown
Contributor Author

Okay fixed the library name and reverted my bad commit that changed a bunch of versions in the requirements_all.txt

Hopefully all checks pass this time!

@fabaff fabaff merged commit cf44b77 into home-assistant:dev May 14, 2018
@property
def should_poll(self):
"""Camera should poll periodically."""
return True
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 should this camera poll? The frontend drives the camera updates.

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.

It seems I misunderstood what this does, I can fix it along with the method name later tonight and resubmit the PR.

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.

Great! Please open a new PR based on fresh dev, as this PR is merged.

self._name = name
self.family_hub_cam = family_hub_cam

async def camera_image(self):
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.

This should be async_camera_image.

@balloob balloob mentioned this pull request May 28, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
* add familyhub.py camera

* fix import and REQUIREMENTS

* add to coveragerc

* fix formatting to make houndci-bot happy

* ran scripts/gen_requirements_all.py

* use CONF_IP_ADDRESS

* Revert "ran scripts/gen_requirements_all.py"

This reverts commit 3a38681.

* fix library name

* add missing docstrings and enable polling

* Sort imports
@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018
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