aklapi

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2020 License: BSD-2-Clause Imports: 7 Imported by: 0

README

Auckland Rubbish and Recycling days webservice

Usage

This simple app exposes 2 endpoints so far, both accepting addr parameter.

  • /api/v1/rr/ - rubbish and recycling, returns the JSON of the following format:

    {
        "rubbish": "2020-02-25",
        "recycle": "2020-02-25",
        "address": "Britomart, CBD"
    }
    
  • /api/v1/rrext/ - extended rubbish and recycling. Returns the JSON in the following format:

    {
        "Collections": [
            {
                "Day": "Monday 24 January",
                "Date": "2020-01-24T00:00:00+13:00",
                "Rubbish": true,
                "Recycle": true
            },
            {
                "Day": "Monday 31 January",
                "Date": "2020-01-31T00:00:00+13:00",
                "Rubbish": true,
                "Recycle": false
            }
        ],
        "Address": {
            "ACRateAccountKey": "12342478585",
            "Address": "500 Queen Street, Auckland Central",
            "Suggestion": "500 Queen Street, Auckland Central"
        }
    }
    

Example:

$ curl --location --request GET 'https://<server>/api/v1/rr/?addr=500%20Queen%20Street'
{"rubbish":"2020-02-24","recycle":"2020-02-24","address":"500 Queen Street, Auckland Central"}
Integrating with Home Assistant

Add the following to your configuration.yaml:

sensor:
  - platform: rest
    resource: https://your_server/api/v1/rr/?addr=500%20Mystreet
    name: Recycle
    value_template: '{{ value_json.recycle }}'

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL