-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Unable to specify start & end time for pumping #122
Comments
I have tried playing with adding this myself and had no luck, the wife has been asking for this feature! |
This one issue was throwing me off. I was setting a time via the service call but it was not actually setting in baby buddy. I would like to bump this for a fix too |
I was running into this issue as well and was causing my wife frustration. I ended up using a rest_command:
add_pumping:
url: [[your instance]]/api/pumping/ # be sure to set this to the address of your baby buddy instance
method: POST
headers:
authorization: !secret baby_buddy_token # but auth token is stored in `secrets.yaml` in the format of `Token abc123`
accept: "application/json, text/html"
content_type: 'application/json'
verify_ssl: false # This was false for me since I don't use ssl
payload: '{"amount": "{{ amount }}", "notes": "{{ notes }}", "child": "{{ child }}", "start": "{{ start }}", "end": "{{ end }}"}' Then in my automation I have service: rest_command.add_pumping
data:
start: >-
{{(states('input_datetime.pumping_start_time') |
as_datetime).strftime('%Y-%m-%dT%H:%M:%S')}}
end: >-
{{(states('input_datetime.pumping_start_time') |
as_datetime).strftime('%Y-%m-%dT%H:%M:%S')}}
amount: "{{states('input_number.pumping_amount')}}"
notes: "{{states('input_text.pumping_notes') or ''}}"
child: 1 |
I'm trying to add a button that will add a pumping entry with a specific start and end time, but that doesn't seem to be possible currently.
When I add the button via the Lovelace UI, this is the YAML that gets created:
I've tried using a template, and just entering in specific values -- nothing seems to work for setting the start time.
I looked at the OpenAPI schema ( which I found by going to
/api/schema
on my Baby Buddy instance ) and the arguments for adding a pumping don't specifytime
as a field:It looks like the API supports setting a start and end time as of version 2.0.0, same as for feedings -- but the code is only sending a
time
field.I've tried to update the code so that it has a
start
andend
like async_add_feeding and created a PR: #121 -- I'm not a Python dev though, I'm a Go dev; so I probably missed something 😅The text was updated successfully, but these errors were encountered: