Skip to content

Customizable command timeout#15442

Merged
fabaff merged 3 commits intohome-assistant:devfrom
mu4yu3:lich_sensor.command_line
Jul 17, 2018
Merged

Customizable command timeout#15442
fabaff merged 3 commits intohome-assistant:devfrom
mu4yu3:lich_sensor.command_line

Conversation

@mu4yu3
Copy link
Copy Markdown
Contributor

@mu4yu3 mu4yu3 commented Jul 13, 2018

Description:

Related issue (if applicable): fixes #

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

Example entry for configuration.yaml (if applicable):

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.

command = config.get(CONF_COMMAND)
unit = config.get(CONF_UNIT_OF_MEASUREMENT)
value_template = config.get(CONF_VALUE_TEMPLATE)
command_timeout= config.get(CONF_COMMAND_TIMEOUT)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace around operator

vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string,
vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
vol.Optional(CONF_COMMAND_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (81 > 79 characters)

SCAN_INTERVAL = timedelta(seconds=60)

CONF_COMMAND_TIMEOUT='timeout'
DEFAULT_TIMEOUT='15'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace around operator


SCAN_INTERVAL = timedelta(seconds=60)

CONF_COMMAND_TIMEOUT='timeout'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace around operator

@mu4yu3 mu4yu3 force-pushed the lich_sensor.command_line branch from 5d7c165 to 60a81d5 Compare July 13, 2018 09:04
SCAN_INTERVAL = timedelta(seconds=60)

CONF_COMMAND_TIMEOUT ='command_timeout'
DEFAULT_TIMEOUT ='15'
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 an int not a string.

@fabaff
Copy link
Copy Markdown
Member

fabaff commented Jul 14, 2018

You need to update the tests, too.

@mu4yu3
Copy link
Copy Markdown
Contributor Author

mu4yu3 commented Jul 14, 2018

I have tested it locally and the result is successful.

@fabaff
Copy link
Copy Markdown
Member

fabaff commented Jul 14, 2018

That might be but there are unit tests which needs to be updated. This is why Travis fails.

vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string,
vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
vol.Optional(CONF_COMMAND_TIMEOUT, default=DEFAULT_TIMEOUT
): cv.positive_int,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

closing bracket does not match visual indentation

vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA,
vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
vol.Optional(CONF_COMMAND_TIMEOUT, default=DEFAULT_TIMEOUT
): cv.positive_int,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

closing bracket does not match visual indentation

@mu4yu3 mu4yu3 force-pushed the lich_sensor.command_line branch from f34476d to f5b30b5 Compare July 15, 2018 04:40
Copy link
Copy Markdown
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

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

🐦

@fabaff fabaff merged commit 7d7c210 into home-assistant:dev Jul 17, 2018
@ghost ghost removed the in progress label Jul 17, 2018
michaeldavie pushed a commit to michaeldavie/home-assistant that referenced this pull request Jul 31, 2018
* Customizable command timeout

* Change string to int

* update the tests. Do the same thing on the binary_sensor.command_line.
@balloob balloob mentioned this pull request Aug 3, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
* Customizable command timeout

* Change string to int

* update the tests. Do the same thing on the binary_sensor.command_line.
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants