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

Added simple process state monitor source. #3

Merged
merged 3 commits into from Apr 24, 2014

Conversation

@fingon
Copy link
Contributor

commented Apr 23, 2014

[process]
xbmc=XBMC.App

=> ps axw's for XBMC.App, and based on it's presence sets process.xbmc to off/on.

@balloob

This comment has been minimized.

Copy link
Member

commented Apr 23, 2014

Cool, I like this addition.

I do would like to see a few fixes before I can accept it.
For one this probably would generate warnings when run with pylint and pep8. You can test it by installing those two tools using pip: pip install pylint pep8 and running it on your code. Reasons why I think it will generate a warning:

  • Functions without documentation
  • Variable names shorter than 3 characters
  • _update_process_state has an unused parameter force_reload

Some other comments;
Because you can't be sure what is happening within the statemachine it is better to set the state to STATE_ON or STATE_OFF even it is the same as before. The statemachine will not change anything or fire a state_changed event if it is the same.

And another point, just a matter of style preference I guess, but line 40-50 can be replaced with:
state = STATE_ON if any(s in line for line in lines) else STATE_OFF

Line 54-57 don't seem to do anything

balloob added a commit that referenced this pull request Apr 24, 2014
Merge pull request #3 from fingon/process-source-up
Added a simple process state monitor

@balloob balloob merged commit b30aeb1 into home-assistant:master Apr 24, 2014

sfiorini pushed a commit to sfiorini/home-assistant that referenced this pull request Jan 4, 2015
hansmbakker added a commit that referenced this pull request Jun 2, 2015
aa755 referenced this pull request in aa755/home-assistant Dec 11, 2016
Merge pull request #3 from aa755/gmaps
removed more unnecessary fields.
@terrycarlin terrycarlin referenced this pull request Feb 19, 2017

@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017

balloob added a commit that referenced this pull request Jul 18, 2019
ecobee Preset Fix (#25256)
* ecobee Preset Fix

* Celsius Fix

* Checks Fix

* Check Fix #2

* Check Fix #3
balloob added a commit that referenced this pull request Jul 18, 2019
ecobee Preset Fix (#25256)
* ecobee Preset Fix

* Celsius Fix

* Checks Fix

* Check Fix #2

* Check Fix #3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.