@@ -2,25 +2,25 @@ import { fetch } from "@devicescript/net"
2
2
import { readSetting } from "@devicescript/settings"
3
3
4
4
// read configurations
5
- const defaultFeed = await readSetting ( "AIO_FEED " )
6
- const defaultUser = await readSetting ( "AIO_USER " )
7
- const defaultLat = await readSetting < number > ( "AIO_LAT " )
8
- const defaultLon = await readSetting < number > ( "AIO_LON " )
9
- const defaultEle = await readSetting < number > ( "AIO_ELE " )
10
- const key = await readSetting ( "AIO_KEY " )
5
+ const defaultFeed = await readSetting ( "IO_FEED " )
6
+ const defaultUser = await readSetting ( "IO_USER " )
7
+ const defaultLat = await readSetting < number > ( "IO_LAT " )
8
+ const defaultLon = await readSetting < number > ( "IO_LON " )
9
+ const defaultEle = await readSetting < number > ( "IO_ELE " )
10
+ const key = await readSetting ( "IO_KEY " )
11
11
12
12
/**
13
13
* Creates a data point in a Adafruit.io feed using
14
14
* the {@link https://io.adafruit.com/api/docs/#create-data | REST API}
15
15
*
16
16
* This extension uses the following settings:
17
17
*
18
- * - AIO_KEY : (required) access key
19
- * - AIO_FEED : feed name
20
- * - AIO_USER : io.adafruit.com user name
21
- * - AIO_LAT : (optional) latitude (as a number)
22
- * - AIO_LON : (optional) longitude (as a number)
23
- * - AIO_ELE : (optional) elevation (as a number)
18
+ * - IO_KEY : (required) access key
19
+ * - IO_FEED : feed name
20
+ * - IO_USER : io.adafruit.com user name
21
+ * - IO_LAT : (optional) latitude (as a number)
22
+ * - IO_LON : (optional) longitude (as a number)
23
+ * - IO_ELE : (optional) elevation (as a number)
24
24
*
25
25
* @param value numerical value to upload
26
26
* @param options optional latitude longitude
@@ -36,13 +36,13 @@ export async function createData(
36
36
ele ?: number
37
37
}
38
38
) {
39
- if ( ! key ) throw new Error ( "Adafruit.io: missing secret AIO_KEY " )
39
+ if ( ! key ) throw new Error ( "Adafruit.io: missing secret IO_KEY " )
40
40
41
41
const { feed, user, lat, lon, ele } = options || { }
42
42
const u = user || defaultUser
43
- if ( ! u ) throw new Error ( "Adafruit.io: missing setting AIO_USER " )
43
+ if ( ! u ) throw new Error ( "Adafruit.io: missing setting IO_USER " )
44
44
const f = feed || defaultFeed
45
- if ( ! f ) throw new Error ( "Adafruit.io: missing setting AIO_FEED " )
45
+ if ( ! f ) throw new Error ( "Adafruit.io: missing setting IO_FEED " )
46
46
47
47
const la = lat || defaultLat
48
48
const lo = lon || defaultLon
0 commit comments