Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

json result for POST of lock/unlock is empty #4

@vv01f

Description

@vv01f

A customizable answer would be nice to be used in e.g. https://github.com/mwarning/trigger.

currently: curl -XPOST http://:<password>@schalter.hq.c3d2.de:/door/unlock results in {} which is not helpful.

maybe the answer could be customizable with optional arguments, e.g.

  • if strings are ok… curl -XPOST http://:<password>@schalter.hq.c3d2.de:/door/unlock?keyname=lock&type=string&success=OPEN&failure=CLOSED&fallback=UNKNOWN results in {"lock":"OPEN"} when successful and {"lock":"CLOSED"} when not or {"lock":"UNKNOWN"} on error.
  • if it should stay boolean… curl -XPOST http://:<password>@schalter.hq.c3d2.de:/door/unlock?keyname=locked&type=boolean&success=false&failure=true&fallback=false results in {"locked":false} when successful and {"locked":true}

And similar json answer for /door/lock and door.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions