consolidate default blocks
This commit is contained in:
Родитель
f86ba22937
Коммит
23d48e41eb
12
modules.ts
12
modules.ts
|
@ -1,12 +0,0 @@
|
|||
namespace modules {
|
||||
/**
|
||||
* Runs the identify animation on the current device.
|
||||
* @param role
|
||||
*/
|
||||
//% blockId=jacdacselfidentify block="identify"
|
||||
//% group="Services"
|
||||
export function identify() {
|
||||
jacdac.start();
|
||||
jacdac.onIdentifyRequest();
|
||||
}
|
||||
}
|
1
pxt.json
1
pxt.json
|
@ -30,7 +30,6 @@
|
|||
"pipes.ts",
|
||||
"actuator.ts",
|
||||
"diagnostics.ts",
|
||||
"modules.ts",
|
||||
"eventqueue.ts",
|
||||
"ns.ts",
|
||||
"system/constants.ts",
|
||||
|
|
|
@ -439,7 +439,7 @@ namespace jacdac {
|
|||
* Indicates if the client is bound to a server
|
||||
*/
|
||||
//% blockId=jd_client_is_connected block="is %client connected"
|
||||
//% group="Connection" weight=50
|
||||
//% group="Services" weight=50
|
||||
//% blockNamespace="modules"
|
||||
isConnected() {
|
||||
return this.broadcast || !!this.device
|
||||
|
@ -449,7 +449,7 @@ namespace jacdac {
|
|||
* Raised when a server is connected.
|
||||
*/
|
||||
//% blockId=jd_client_on_connected block="on %client connected"
|
||||
//% group="Connection" weight=49
|
||||
//% group="Services" weight=49
|
||||
//% blockNamespace="modules"
|
||||
onConnected(handler: () => void) {
|
||||
this._onConnected = handler
|
||||
|
@ -461,7 +461,7 @@ namespace jacdac {
|
|||
* Raised when a server is connected.
|
||||
*/
|
||||
//% blockId=jd_client_on_disconnected block="on %client disconnected"
|
||||
//% group="Connection" weight=48
|
||||
//% group="Services" weight=48
|
||||
//% blockNamespace="modules"
|
||||
onDisconnected(handler: () => void) {
|
||||
this._onDisconnected = handler
|
||||
|
|
|
@ -62,6 +62,6 @@ namespace modules {
|
|||
}
|
||||
|
||||
}
|
||||
//% fixedInstance whenUsed block="settings 1"
|
||||
export const settings1 = new SettingsClient("settings1");
|
||||
//% fixedInstance whenUsed
|
||||
export const settings = new SettingsClient("settings");
|
||||
}
|
Загрузка…
Ссылка в новой задаче