Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services.

Overview

Tidbyt Client for Node.js

Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services.

Installation

You can install the package with npm:

> npm install tidbyt

Usage

const Tidbyt = require('tidbyt')

async function main() {
    const deviceId = process.argv[2]
    const tidbyt = new Tidbyt(process.env.TIDBYT_API_TOKEN)

    // get our requested device
    const device = await tidbyt.devices.get(deviceId)
    const { displayName, lastSeen } = device

    console.log(displayName, `Last Seen: (${lastSeen})`)

    // get a list of officially available apps
    // return as map so we can lookup app name/descriptions by id
    const apps = await tidbyt.apps.list({ asMap: true })

    // get the list of installations for this device
    const installations = await device.installations.list()

    for (const { id, appID } of installations) {
        const {
            name = 'Custom',
            description = `Unlike a regular Tidbyt app, this "installation" was pushed to ${displayName} via Tidbyt's API.`,
        } = apps.get(appID) || {}

        console.log(``)
        console.log(`  ${name} - ${id}`)
        console.log(`      ${description}`)
    }
}
main()

Classes

TidbytDevice
Tidbyt

TidbytDevice

Kind: global class
Scope: Tidbyt

new TidbytDevice(options, client)

Construct a TidbytDevice with provided options.

A valid client is required to use any methods.

Available options:

 - `id`: the device id

 - `lastSeen`: the last time the device was seen

 - `brightness`: the brightness of the device from 0-100

 - `displayName`: the display name of the device

 - `autoDim`: whether the device is auto dimming at night
Param Type
options Object
client TidByt

tidbytDevice.installations : object

Kind: instance property of TidbytDevice

installations.list() ⇒ Promise.<Array.<TidbytDeviceInstallation>>

Return a list of installations on the device from the Tidbyt API.

Kind: instance method of installations

installations.update(installationID, image) ⇒ Promise.<Object>

Update an existing installation with a new image.

Throws if not client is intialized.

Kind: instance method of installations

Param Type Description
installationID String Optional installation ID to create/update
image Buffer Buffer containing the images to push

installations.delete(installationID) ⇒ Promise.<Object>

Delete an existing installation from the device.

Throws if not client is intialized.

Kind: instance method of installations

Param Type Description
installationID String Optional installation ID to create/update

tidbytDevice.update(updates) ⇒ Promise.<TidbytDevice>

Update a device with the provided values.

Throws if not client is intialized.

Available fields:

 - `autoDim`: whether the device is auto dimming at night

 - `brightness`: the brightness of the device from 0-100

 - `displayName`: the display name of the device

Kind: instance method of TidbytDevice

Param Type
updates Object

tidbytDevice.push(image, [installationID]) ⇒ Promise.<Object>

Push a new installation to the device.

Throws if not client is intialized.

Kind: instance method of TidbytDevice

Param Type Description
image Buffer Buffer containing the images to push
[installationID] String Optional installation ID to create/update

Tidbyt

Kind: global class

new Tidbyt(apiToken, version)

Construct a Tidbyt with provided options.

Available options:

 - `apiToken`: the API token

 - `apiVersion`: the API version. Defaults to `v0`
Param Type Default
apiToken String
version String 'v0'

tidbyt.apps : object

Kind: instance property of Tidbyt

apps.list(options) ⇒ Promise.<(Array.<Object>|Map)>

Return a list of available apps from the Tidbyt API.

Available options:

 - `asMap`: Defaults to false. If true, returns a map of app ids to app objects instead of an array of app objects.

Kind: instance method of apps

Param Type
options Object

tidbyt.devices : object

Kind: instance property of Tidbyt

devices.get(deviceId) ⇒ Promise.<TidbytDevice>

Get a device by id from the Tidbyt API.

Kind: instance method of devices

Param Type Description
deviceId String The device id

devices.update(deviceId, updates) ⇒ Promise.<TidbytDevice>

Update a device with the provided values by ID.

Available updates:

 - `autoDim`: whether the device is auto dimming at night

 - `brightness`: the brightness of the device from 0-100

 - `displayName`: the display name of the device

Kind: instance method of devices

Param Type Description
deviceId String The device id
updates Object

devices.push(deviceId, image, [installationID]) ⇒ Promise.<Object>

Push a new installation to a device by ID.

Throws if not client is intialized.

Kind: instance method of devices

Param Type Description
deviceId String The device id
image Buffer Buffer containing the images to push
[installationID] String Optional installation ID to create/update

tidbyt.request(path, method, body, headers, raw, encoding) ⇒ Promise.<(Object|Buffer)>

Send a request to the Tidbyt API.

Kind: instance method of Tidbyt

Param Type Default
path String
method String 'GET'
body Object
headers Object {}
raw Boolean
encoding String
You might also like...

Chat app using Azure Web PubSub, Static Web Apps and other Azure services

Chat app using Azure Web PubSub, Static Web Apps and other Azure services

Chatr - Azure Web PubSub Sample App This is a demonstration & sample application designed to be a simple multi-user web based chat system. It provides

Dec 31, 2022

A lightweight Nano Node implementation made for wallets, exchanges and other services.

About This is a Light Nano Node implementation made for Wallets, Exchanges and other services. This Node has been built to be compatible with the offi

Jun 25, 2022

JavaScript/TypeScript library to run repetitive tasks with throttle control and other cool features

JavaScript/TypeScript library to run repetitive tasks with throttle control and other cool features

Repeatify JavaScript/TypeScript library to run repetitive tasks with throttle control and other cool features Install npm install repeatify Usage impo

Jan 15, 2022

jQuery based scrolling Bar, for PC and Smartphones (touch events). It is modern slim, easy to integrate, easy to use. Tested on Firefox/Chrome/Maxthon/iPhone/Android. Very light 7ko min.js and 1Ko min.css.

Nice-Scrollbar Responsive jQuery based scrolling Bar, for PC and Smartphones (touch events). It is modern slim, easy to integrate, easy to use. Tested

Jan 18, 2022

A simple (and unofficial) GitHub Trending client that lives in your menubar.

A simple (and unofficial) GitHub Trending client that lives in your menubar.

Raise A simple (and unofficial) GitHub Trending client that lives in your menubar. 📸 Screenshots 🖥 Installation New!! Raise is now available as a Ch

Dec 20, 2022

This is an unofficial front end for Hacker News, reminiscent of the Windows XP era Outlook email client on a Windows XP default desktop

This is an unofficial front end for Hacker News, reminiscent of the Windows XP era Outlook email client on a Windows XP default desktop

Hacker XP Hacker News styled as the Windows XP Outlook email client. Try out Hacker XP here! Description This is an unofficial front end for Hacker Ne

Jul 12, 2022

Unofficial WhatsApp Linux client built with Electron.

WhatsApp Desktop for Linux (unofficial) WhatsApp Linux client built with Electron. As WhatsApp doesn't compile the official app for Linux, here is an

Jan 3, 2023

A fast and powerful http toolkit that take a list of domains to find active domains and other information such as status-code, title, response-time , server, content-type and many other

A fast and powerful http toolkit that take a list of domains to find active domains and other information such as status-code, title, response-time , server, content-type and many other

HTTPFY curently in beta so you may see problems. Please open a Issue on GitHub and report them! A Incredible fast and Powerful HTTP toolkit Report Bug

Dec 22, 2022

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.

Sortable Sortable is a JavaScript library for reorderable drag-and-drop lists. Demo: http://sortablejs.github.io/Sortable/ Features Supports touch dev

Jan 5, 2023
Comments
  • No results from Push

    No results from Push

    Struggling to push to my device.

    I can List Installations so I know the API works.

    I'm able to render a webp.

    The push doesn't seem to achieve anything. My app doesn't show up.

    I get no results when I run it manually.

    Attached is a slightly censored version of my workflow.

    My_workflow.txt

    opened by keithnet 1
  • Configure Renovate

    Configure Renovate

    WhiteSource Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • package.json (npm)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation
    • If semantic commits detected, use semantic commit type fix for dependencies and chore for all others
    • Ignore node_modules, bower_components, vendor and various test/tests directories
    • Autodetect whether to pin dependencies or maintain ranges
    • Rate limit PR creation to a maximum of two per hour
    • Limit to maximum 10 open PRs at any time
    • Group known monorepo packages together
    • Use curated list of recommended non-monorepo package groupings
    • Fix some problems with very old Maven commons versions
    • Ignore spring cloud 1.x releases
    • Ignore web3j 5.0.0 release
    • Ignore http4s digest-based 1.x milestones
    • Use node versioning for @types/node
    • Limit concurrent requests to reduce load on Repology servers until we can fix this properly, see issue 10133
    • Do not upgrade from Alpine stable to edge

    🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    With your current configuration, Renovate will create 4 Pull Requests:

    Update dependency markdown-it to 12.3.2 [SECURITY]
    • Branch name: renovate/npm-markdown-it-vulnerability
    • Merge into: main
    • Upgrade markdown-it to 12.3.2
    Update dependency marked to 4.0.10 [SECURITY]
    • Branch name: renovate/npm-marked-vulnerability
    • Merge into: main
    • Upgrade marked to 4.0.10
    Pin dependency jsdoc-to-markdown to v
    • Schedule: ["at any time"]
    • Branch name: renovate/pin-dependencies
    • Merge into: main
    • Pin jsdoc-to-markdown to 7.1.0
    Update dependency jsdoc-to-markdown to v7.1.1
    • Schedule: ["at any time"]
    • Branch name: renovate/jsdoc-to-markdown-7.x
    • Merge into: main
    • Upgrade jsdoc-to-markdown to 7.1.1

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Bump minimist from 1.2.5 to 1.2.6

    Bump minimist from 1.2.5 to 1.2.6

    Bumps minimist from 1.2.5 to 1.2.6.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump minimatch from 3.0.4 to 3.1.2

    Bump minimatch from 3.0.4 to 3.1.2

    Bumps minimatch from 3.0.4 to 3.1.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
Nicholas Penree
I write JavaScript for all the things.
Nicholas Penree
This repository demonstrates how to integrate your Dialogflow agent with 3rd-party services services using a Node.JS backend service

This repository demonstrates how to integrate your Dialogflow agent with 3rd-party services services using a Node.JS backend service. Integrating your service allows you to take actions based on end-user expressions and send dynamic responses back to the end-user.

ddayto 10 Jul 21, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Calculates maximum composite SLA for a list of sequentially provided cloud services or your custom-defined services.

SlaMax Calculates maximum composite SLA for a list of sequentially provided cloud services or your custom-defined services. Here are a few use-cases y

Mikael Vesavuori 4 Sep 19, 2022
A three.js and roslibjs powered web-control for zju fast-drone-250 for laptop-free flight control

Web Control for ZJU Fast-Drone-250 A three.js and roslibjs powered web-control for zju fast-drone-250 for laptop-free flight control (tested on Xiaomi

null 6 Nov 11, 2022
Web based application that uses playerctl in it backend to control remotely your audio using the frontend as remote control.

Linux Remote This is a web based application that uses playerctl in it backend to control remotely your audio using the frontend as remote control. Do

Gabriel Guerra 4 Jul 6, 2022
A NestJS module that allows you use Prisma, set up multiple Prisma services, and use multi-tenancy in each Prisma service.

NestJS Prisma Module Installation To use this package, first install it: npm i @sabinthedev/nestjs-prisma Basic Usage In order to use this package, yo

Sabin Adams 39 Dec 2, 2022
An unofficial companion tool created for use alongside PhotoPrism to enable API endpoints and automation.

PhotoPrism Helper PhotoPrism Helper is an unofficial companion tool created for use alongside PhotoPrism. This project isn't associated with the Photo

Ryan Miller 9 Dec 25, 2022