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

Set directv unavailable state when errors returned for longer then a minute #19014

Merged
merged 2 commits into from Dec 7, 2018

Conversation

Projects
None yet
3 participants
@ehendrix23
Copy link
Contributor

ehendrix23 commented Dec 4, 2018

Description:

Change setting to unavailable when getting request exceptions only after 1 minute has past since 1st occurrence, preventing state set to unavailable when powering on/off.

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.

If the code does not interact with devices:

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

@wafflebot wafflebot bot added the in progress label Dec 4, 2018

@ehendrix23 ehendrix23 referenced this pull request Dec 5, 2018

Open

Implement RVU Genie client device discovery #19049

6 of 6 tasks complete

@ehendrix23 ehendrix23 changed the title Set unavailable state if request issue for more then a minute Set unavailable state when errors returned for longer then a minute Dec 5, 2018

self._available = False
# If an error is received then only set to unavailable if
# this started at least 1 minute ago.
if not self._first_error_timestamp:

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Dec 6, 2018

Member

Can we make a small helper method for the common parts of the if else block so we don't need to repeat everything twice?

This comment has been minimized.

@ehendrix23

ehendrix23 Dec 6, 2018

Contributor

Absolutely. :-) Done.

ehendrix23 added some commits Dec 4, 2018

Fix unavailable
Change setting to unavailable when getting request exceptions only after 1 minute has past since 1st occurrence.
Put common code in _check_state_available
Put common code to determine if available should be set to False in method _check_state_available

@ehendrix23 ehendrix23 force-pushed the ehendrix23:Fix-unavailable-state branch from f399222 to d37d15e Dec 6, 2018

@MartinHjelmare MartinHjelmare changed the title Set unavailable state when errors returned for longer then a minute Set directv unavailable state when errors returned for longer then a minute Dec 7, 2018

@MartinHjelmare MartinHjelmare merged commit 8a62bc9 into home-assistant:dev Dec 7, 2018

4 checks passed

Hound No violations found. Woof!
WIP Legacy commit status override — see details
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wafflebot wafflebot bot removed the in progress label Dec 7, 2018

@ehendrix23 ehendrix23 deleted the ehendrix23:Fix-unavailable-state branch Dec 7, 2018

mxworm added a commit to mxworm/home-assistant that referenced this pull request Dec 7, 2018

Merge branch 'dev' into current
* dev: (52 commits)
  Set lock status correctly for Schlage BE469 Z-Wave locks (home-assistant#18737)
  Upgrade Tibber lib (home-assistant#19098)
  Bump skybellpy version to fix api issue (home-assistant#19100)
  Automatically detect if ipv4/ipv6 is used for cert_expiry (home-assistant#18916)
  Upgrade pyatv to 0.3.12 (home-assistant#19085)
  Bump lakeside requirement to support more Eufy devices (home-assistant#19080)
  Set directv unavailable state when errors returned for longer then a minute (home-assistant#19014)
  Updated frontend to 20181207.0
  Force refresh Lovelace (home-assistant#19073)
  Upgrade aiolifx to 0.6.7 (home-assistant#19077)
  Fix missing colorTemperatureInKelvin from Alexa responses (home-assistant#19069)
  Add CM17A support (home-assistant#19041)
  Upgrade pylint to 2.2.2 (home-assistant#18750)
  Revert home-assistant#17745 (home-assistant#19064)
  Bumped version to 0.85.0.dev0
  Add support for more Tibber Pulse data (home-assistant#19033)
  Update locationsharinglib to 3.0.9 (home-assistant#19045)
  Implemented unique ID support for Fibaro hub integration (home-assistant#19055)
  Update pyhomematic to 0.1.53 (home-assistant#19056)
  Fix saving YAML as JSON with empty array (home-assistant#19057)
  ...

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

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