Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Add comments etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
smittytone committed Mar 1, 2019
1 parent 10ca287 commit 6dbefd4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
32 changes: 16 additions & 16 deletions DarkSky.agent.lib.nut
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Dark Sky API, ie. forecast requests and time-machine requests. For
* more information, see https://darksky.net/dev/docs
* Access to the API is controlled by key. Register for developer access
* here: https://darksky.net/dev/register
* here: https://darksky.net/dev/register.
*
* NOTE this class does not parse the incoming data, which is highly complex.
* It is up to your application to extract the data you require
* It is up to your application to extract the data you require.
*
* @author Tony Smith (@smittytone)
* @copyright Electric Imp, Inc. 2016-18
* @copyright Electric Imp, Inc. 2016-19
* @license MIT
*
* @class
Expand Down Expand Up @@ -38,13 +38,15 @@ class DarkSky {
_debug = false;

/**
* The Dark Sky construtor
* The Dark Sky construtor.
*
* @constructor
*
* @param {string} apiKey - Your Dark Sky service API key.
* @param {bool} [debug] - Whether to log extra debugging info (true) or not (false). Default: false.
*
* returns {instance} this
*
*/
constructor (key = null, debug = false) {
// Check for instantiation parameter errors
Expand All @@ -60,7 +62,7 @@ class DarkSky {
}

/**
* Make a request for future weather data
* Make a request for future weather data.
*
* @param {float} longitude - Longitude of location for which a forecast is required.
* @param {float} latitude - Latitude of location for which a forecast is required.
Expand Down Expand Up @@ -89,7 +91,7 @@ class DarkSky {
}

/**
* Make a request for historical weather data
* Make a request for historical weather data.
*
* @param {float} longitude - Longitude of location for which a forecast is required.
* @param {float} latitude - Latitude of location for which a forecast is required.
Expand Down Expand Up @@ -135,7 +137,7 @@ class DarkSky {
}

/**
* Get the current Dakr Sky API call count
* Get the current Dakr Sky API call count.
*
* @returns {integer} The most recent call count.
*
Expand All @@ -145,7 +147,7 @@ class DarkSky {
}

/**
* Specify the preferred weather report's units
* Specify the preferred weather report's units.
*
* @param {string} [units] - Country code indicating the type of units. Default: automatic, based on location.
*
Expand Down Expand Up @@ -175,7 +177,7 @@ class DarkSky {
}

/**
* Specify the preferred weather report's language
* Specify the preferred weather report's language.
*
* @param {string} [language] - Country code indicating the language. Default: English.
*
Expand Down Expand Up @@ -208,7 +210,7 @@ class DarkSky {
// ********** PRIVATE FUNCTIONS - DO NOT CALL **********

/**
* Specify the preferred weather report's language
* Send a request to Dark Sky.
*
* @private
*
Expand Down Expand Up @@ -239,7 +241,7 @@ class DarkSky {
*/

/**
* Process a response received from Dark Sky
* Process a response received from Dark Sky.
*
* @private
*
Expand Down Expand Up @@ -273,7 +275,7 @@ class DarkSky {
}

/**
* Extract daily API request count from Dark Sky response header
* Extract daily API request count from Dark Sky response header.
*
* @private
*
Expand All @@ -297,7 +299,7 @@ class DarkSky {
}

/**
* Check that valid co-ords have been supplied
* Check that valid co-ords have been supplied.
*
* @private
*
Expand Down Expand Up @@ -346,9 +348,7 @@ class DarkSky {
}

/**
* Add URL-encoded options to the request URL
*
* Used when assembling HTTPS requests
* Add URL-encoded options to the request URL. Used when assembling HTTPS requests.
*
* @private
*
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ See [*setUnits()*](#setunitsunits), above, for an example of *setLanguage()*’s
- Adopt current Electric Imp library naming scheme.
- Version number now a string.
- Instantiation parameter errors now throw.
- Minor code improvements.
- Bug fixes:
- Synchronous operation variables now correctly named.
- Prevent null string error.
- 1.0.1
- Fix uninitialized member property.
- 1.0.0
Expand Down

0 comments on commit 6dbefd4

Please sign in to comment.