Skip to content

Commit

Permalink
Merge pull request #334 from amhyder/utc_time_fix
Browse files Browse the repository at this point in the history
Fix behavior for "execute chore now" support
  • Loading branch information
isabellaalstrom authored Feb 4, 2025
2 parents b95691a + 39e496e commit 0053b63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions custom_components/grocy/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ def wrapper():


async def async_execute_chore_service(hass, coordinator, data):
should_track_now = data.get(SERVICE_EXECUTION_NOW, True)
should_track_now = data.get(SERVICE_EXECUTION_NOW, False)

"""Execute a chore in Grocy."""
chore_id = data[SERVICE_CHORE_ID]
done_by = data.get(SERVICE_DONE_BY, "")
tracked_time = datetime.utcnow() if should_track_now else None
tracked_time = datetime.now() if should_track_now else None
skipped = data.get(SERVICE_SKIPPED, False)

def wrapper():
Expand Down
2 changes: 1 addition & 1 deletion custom_components/grocy/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ execute_chore:
track_execution_now:
name: Execution now
example: false
default: true
default: false
required: false
description: If the chore execution should be tracked with the time now
selector:
Expand Down

0 comments on commit 0053b63

Please sign in to comment.