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 Slide cover #25913

Merged
merged 10 commits into from Sep 3, 2019
Merged

Add support Slide cover #25913

merged 10 commits into from Sep 3, 2019

Conversation

ualex73
Copy link
Contributor

@ualex73 ualex73 commented Aug 13, 2019

Breaking Change:

None

Description:

Add support Slide cover integration (Cloud API).

Related issue (if applicable): None

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

Example entry for configuration.yaml (if applicable):

slide:
  username: YOUR_SLIDE_APP_USERNAME
  password: YOUR_SLIDE_APP_PASSWORD

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.

@ualex73 ualex73 changed the title Add support GoSlide cover Add support Slide cover Aug 18, 2019
@ualex73
Copy link
Contributor Author

ualex73 commented Aug 29, 2019

Will anybody from the HA team will look into this PR?

homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/cover.py Outdated Show resolved Hide resolved
homeassistant/components/slide/cover.py Outdated Show resolved Hide resolved
homeassistant/components/slide/cover.py Outdated Show resolved Hide resolved
homeassistant/components/slide/cover.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Show resolved Hide resolved
Dev automation moved this from Needs review to Review in progress Aug 31, 2019
@ualex73
Copy link
Contributor Author

ualex73 commented Aug 31, 2019

@MartinHjelmare I am reworking the init.py/cover.py/const.py at this moment and i will test the new code, before committing it again. I have replied to a few code reviews (the exception and login, aiohttp session, retry and timeout configuration items)

Removed DOMAIN not exist check
Changed if to min/max
Changed 3rd party import to top of the module
Removed timeout/retry parameters
Removed unused constants
Added check for discovery_info is none
Changed pass slide object instead of full hass object
Changed pass api object instead of full hass object
Added unique_id functionality
Removed entity_id/name properties
Removed supported_features/state functions
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/slide/cover.py Outdated Show resolved Hide resolved
homeassistant/components/slide/cover.py Outdated Show resolved Hide resolved
homeassistant/components/slide/manifest.json Show resolved Hide resolved
@MartinHjelmare MartinHjelmare added the second-opinion-wanted Add this label when a reviewer needs a second opinion from another member. label Sep 1, 2019
@project-bot project-bot bot moved this from Review in progress to Second opinion wanted in Dev Sep 1, 2019
Changed Improved exception handling
Changed Updated Slide API to 0.50.0
Changed retry setup into coroutine
@balloob balloob removed the second-opinion-wanted Add this label when a reviewer needs a second opinion from another member. label Sep 3, 2019
@MartinHjelmare MartinHjelmare moved this from Second opinion wanted to Review in progress in Dev Sep 3, 2019
@ualex73
Copy link
Contributor Author

ualex73 commented Sep 3, 2019

@MartinHjelmare I am still new with the process, but it looks like I don't have any open points/changed pending from my side?

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.

It's not required for this PR, but it would be good to update the library to use aiohttp client session api.

except (goslideapi.ClientConnectionError, goslideapi.ClientTimeoutError) as err:
_LOGGER.error(
"Error connecting to Slide Cloud: %s, going to retry in %s seconds",
str(err),
Copy link
Member

Choose a reason for hiding this comment

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

The exception argument has a __str__ magic method.

Suggested change
str(err),
err,

async_call_later(hass, DEFAULT_RETRY, retry_setup)
return True

if result:
Copy link
Member

Choose a reason for hiding this comment

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

If we invert this check and log error and return False if true, we can outdent the debug log.

Suggested change
if result:
if not result:

Changed invert if result to if not result
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.

Great!

Dev automation moved this from Review in progress to Reviewer approved Sep 3, 2019
@MartinHjelmare
Copy link
Member

Can be merged when build passes.

@balloob balloob merged commit 330ae0d into home-assistant:dev Sep 3, 2019
Dev automation moved this from Reviewer approved to Done Sep 3, 2019
@lock lock bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants