How to use the thingpedia.Availability function in thingpedia

To help you get started, we’ve selected a few thingpedia examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stanford-oval / thingpedia-common-devices / com.parklonamerica.heatpad / device.js View on Github external
checkAvailable: function() {
        return Tp.Availability.AVAILABLE;
    },
});
github stanford-oval / thingengine-core / lib / device-classes / thingengine / device.js View on Github external
checkAvailable: function() {
        if (this.own && this.tier === this._tierManager.ownTier)
            return Tp.Availability.AVAILABLE;
        else if (this.tier === Tp.Tier.GLOBAL)
            return Tp.Availability.AVAILABLE;
        else if (this.own)
            return (this._tierManager.isConnected(this.tier) ?
                    Tp.Availability.AVAILABLE :
                    Tp.Availability.UNAVAILABLE);
        else if (this.engine.messaging.isAvailable)
            return Tp.Availability.AVAILABLE;
        else
            return Tp.Availability.UNAVAILABLE;
    },
github stanford-oval / thingpedia-common-devices / com.tumblr / device.js View on Github external
checkAvailable() {
        return Tp.Availability.AVAILABLE;
    },
github stanford-oval / almond-android / jsapp / thingengine.phone.js View on Github external
checkAvailable() {
        if (Tp.Tier.PHONE === this._tierManager.ownTier) {
            return Tp.Availability.AVAILABLE;
        } else {
            return (this._tierManager.isConnected(Tp.Tier.PHONE) ?
                    Tp.Availability.AVAILABLE :
                    Tp.Availability.OWNER_UNAVAILABLE);
        }
    }
github stanford-oval / thingengine-core / lib / devices / thingpedia / builtins / thingengine.home / index.js View on Github external
checkAvailable() {
        if (Tp.Tier.SERVER === this._tierManager.ownTier) {
            return Tp.Availability.AVAILABLE;
        } else {
            return (this._tierManager.isConnected(Tp.Tier.SERVER) ?
                    Tp.Availability.AVAILABLE :
                    Tp.Availability.OWNER_UNAVAILABLE);
        }
    }
github stanford-oval / thingengine-core / lib / devices / generic.js View on Github external
checkAvailable: function() {
            return Tp.Availability.AVAILABLE;
        },
github stanford-oval / thingengine-core / lib / devices / builtins / bluetooth.generic.js View on Github external
return btApi.readUUIDs(this.hwAddress).then((uuids) => {
            if (uuids !== null)
                return Tp.Availability.AVAILABLE;
            else
                return Tp.Availability.UNAVAILABLE;
        });
    }
github stanford-oval / thingengine-core / engine / device-classes / weather / device.js View on Github external
checkAvailable: function() {
        return Tp.Availability.AVAILABLE;
    }
});