1.1.2 • Published 8 months ago

pharos-controllers v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

pharos-controllers

GitHub issues npm npm GitHub

Library written in TypeScript to control Pharos Lighting controllers via the HTTP rest API.

Available commands

  • authenticate()
  • logout()

ONLY DESIGNER

  • getTimelines()
  • getGroups()
  • getScenes()
  • controllTimeline()
  • controlGroup()
  • controlScene()

ONLY EXPERT

  • getSpaces()
  • controlSpace()
  • controlScene()

Example Designer:

import { DesignerClient } from 'pharos-controllers'

const controller = new DesignerClient('192.168.0.10')

async function example() {
	await controller.authenticate('admin', 'admin')
	// returns success true/false if false an error is returned as well

	const timelines = await controller.getTimelines()
	// returns success and all timelines

	const groups = await controller.getGroups('1-10')
	// returns success and groups 1 through 10

	await controller.controlTimeline('start', { num: 7 })
	// starts timeline number 7 and returns success true/false

	await controller.controlTimeline('release', { fade: 5 })
	// releases all timelines with a fade of 5 seconds

	await controller.controlTimeline('set_rate', { num: 3, rate: '0.5' })
	// sets the rate of timeline 3 to 50% of the default rate

	const logout = await controller.logout()
	// returns success true/false
}

example()

Example Designer:

import { ExpertClient } from 'pharos-controllers'

const controller = new ExpertClient('192.168.0.20')

async function example() {
	await controller.authenticate('admin', 'admin')
	// returns success true/false if false an error is returned as well

	await controller.getSpaces('1-3')
	// returns info about space 1 till 3

	await controller.controlScene('recall', { num: 5 })
	// recalls scene 5 and returns success true/false

	await controller.controlSpace('master_intensity', { num: 3, level: 82.3 })

	await controller.logout()
	// returns success true/false
}
1.1.2

8 months ago

1.1.0

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

2.5.9

11 months ago

2.0.0

11 months ago