Skip to content

Add counter component#9146

Merged
pvizeli merged 1 commit into
devfrom
counter
Aug 29, 2017
Merged

Add counter component#9146
pvizeli merged 1 commit into
devfrom
counter

Conversation

@fabaff
Copy link
Copy Markdown
Member

@fabaff fabaff commented Aug 26, 2017

Description:

This PR is based on the idea of #6880 and uses the same configuration variables. It is not a sensor but a component now and still provides increment, decrement and reset as a service for automations.

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

Example entry for configuration.yaml (if applicable):

counter:
  count1:
    name: Count1
    initial: 10
    step: 3
  count0:
    name: Count0
    icon: mdi:baby-buggy

Checklist:

If user exposed functionality or configuration variables are added/changed:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@mention-bot
Copy link
Copy Markdown

@fabaff, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pvizeli, @konikvranik and @postlund to be potential reviewers.

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Aug 27, 2017

I think instead to have a counter we should make a timer component with a nice UI card. For timer we can also make dynamic timers that can be create and delete and change on runtime. The state if a timer is run/stop/pause and fire a event on zero. That help to not make a state to db every time where the counter change like this

@fabaff
Copy link
Copy Markdown
Member Author

fabaff commented Aug 28, 2017

This component doesn't not depend on time. If I understand your comment right then you are talking about something like a countdown from 10 min and then do something.

Incrementing and decrementing happens when the service is executed. Like do something for x times while you know that after x+n times you have to replace the battery, so show a notification when x+m is reached.

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Aug 29, 2017

Okay, now is clear, thanks

@pvizeli pvizeli merged commit 0687a45 into dev Aug 29, 2017
@pvizeli pvizeli deleted the counter branch August 29, 2017 13:45
matemaciek added a commit to matemaciek/home-assistant that referenced this pull request Aug 30, 2017
* upstream/dev: (113 commits)
  Fix fitbit error when trying to access token after upgrade. (home-assistant#9183)
  Upgrade sendgrid to 5.0.1 (home-assistant#9215)
  Upgrade pyasn1 to 0.3.3 and pyasn1-modules to 0.1.1 (home-assistant#9216)
  directv: extended discovery via REST api, bug fix  (home-assistant#8800)
  Bayesian Binary Sensor (home-assistant#8810)
  Add cloud auth support (home-assistant#9208)
  Abode push events and lock, cover, and switch components (home-assistant#9095)
  Lint Sonarr tests
  Upgrade pymysensors to 0.11.1 (home-assistant#9212)
  Refactor rfxtrx (home-assistant#9117)
  Issue home-assistant#6893 in rfxtrx (home-assistant#9130)
  Support for season sensor (home-assistant#8958)
  Add counter component (home-assistant#9146)
  Fix and optimize digitalloggers platform (home-assistant#9203)
  Prevent error when no forecast data was available (home-assistant#9176)
  Add "status" to Sonarr sensor (home-assistant#9204)
  fix worldtidesinfo home-assistant#9184 (home-assistant#9201)
  Update pushbullet.py (home-assistant#9200)
  Fix dht22 when no data was read initially home-assistant#8976 (home-assistant#9198)
  Prevent iCloud exceptions in logfile (home-assistant#9179)
  ...
@balloob balloob mentioned this pull request Sep 7, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Dec 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants