Skip to content

Fix type errors, decrease timeout, and handle files properly#14685

Closed
dfiel wants to merge 1 commit intohome-assistant:devfrom
dfiel:dev
Closed

Fix type errors, decrease timeout, and handle files properly#14685
dfiel wants to merge 1 commit intohome-assistant:devfrom
dfiel:dev

Conversation

@dfiel
Copy link
Contributor

@dfiel dfiel commented May 29, 2018

Description:

Solves #11983 while merging #11942 into existing fixes.
Fixes type errors introduced with shared state object, decreases the timeout before the state object grabs new data from the controller, and integrated file handling fixes.

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.

})

MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=1)
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=5)
Copy link
Member

Choose a reason for hiding this comment

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

For polling data over TCP this is very fast as there is no session used.

See dfiel/greenwavereality#1 for the request to add a timeout.

import greenwavereality as greenwave
import os
host = config.get(CONF_HOST)
host = str(config.get(CONF_HOST))
Copy link
Member

Choose a reason for hiding this comment

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

This is not needed. The configuration validation only allows strings.

self._host = str(host)
self._online = greenwave.check_online(light)
self._token = token
self._token = str(token)
Copy link
Member

Choose a reason for hiding this comment

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

This should be fixed upstream.

dfiel/greenwavereality#2

@fabaff
Copy link
Member

fabaff commented Aug 7, 2018

This PR seems to gone stale. Please re-open it when you want to proceed.

@fabaff fabaff closed this Aug 7, 2018
@lukewakeford
Copy link

@fabaff 👋 - I've just made your suggested changes, trying to figure out how to test this and get things back up and running. any pointers appreciated.

dfiel/greenwavereality#3

@lukewakeford
Copy link

@fabaff bump

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants