Skip to content

Commit

Permalink
Merge pull request #18 from stagetimerio/main
Browse files Browse the repository at this point in the history
Release v2.2.1
  • Loading branch information
lhermann authored Jul 20, 2024
2 parents ca05bf7 + 331d139 commit 099cd4c
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 17 deletions.
46 changes: 44 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,52 @@
# Changelog

## 2.0.0 (2023-07-05)

## v2.2.1

- Fixes new accepted alphabet for room IDs.
- Fixes handling of empty `current_timer` and `next_timer` socket events.

## v2.2.0: Adds reset action and multiple variables

New features:
- Adds action `Transport: Reset`: Reset or restart the currently highlighted timer, utilizing the new `/reset` API endpoint. (Resolves #11 and #14)
- Handles new socket events `current_timer` and `next_timer`. See https://stagetimer.io/changelog/#version-213.
- Adds new variables for the time display. The time display is equal to the Stagetimer output, taking [timer appearance](https://stagetimer.io/docs/using-timers/#timer-appearances) into account ([Docs](https://stagetimer.io/docs/viewer/#3-timer)). (Resolves #12)
- `$(stagetimer:timeDisplay)` - Time Display
- `$(stagetimer:timeDisplayHours)` - Time Display (hours)
- `$(stagetimer:timeDisplayMinutes)` - Time Display (minutes)
- `$(stagetimer:timeDisplaySeconds)` - Time Display (seconds)
- Adds some variable about the current timer:
- `$(stagetimer:currentTimerStartTime12h)` - Hard start time (12h format, [Docs](https://stagetimer.io/docs/using-timers/#using-the-start-time-properly))
- `$(stagetimer:currentTimerStartTime24h)`- Hard start time (24h format, [Docs](https://stagetimer.io/docs/using-timers/#using-the-start-time-properly))
- Adds all new variables about the next timer:
- `$(stagetimer:nextTimerId)` - Timer ID
- `$(stagetimer:nextTimerName)` - Timer name
- `$(stagetimer:nextTimerSpeaker)` - Timer speaker
- `$(stagetimer:nextTimerNotes)` - Timer notes
- `$(stagetimer:nextTimerAppearance)` – Timer appearance ([Docs](https://stagetimer.io/docs/using-timers/#timer-appearances))
- `$(stagetimer:nextTimerStartTime12h)` - Hard start time (12h format, [Docs](https://stagetimer.io/docs/using-timers/#using-the-start-time-properly))
- `$(stagetimer:nextTimerStartTime24h)`- Hard start time (24h format, [Docs](https://stagetimer.io/docs/using-timers/#using-the-start-time-properly))
- `$(stagetimer:nextTimerDuration)` - Timer duration
- `$(stagetimer:nextTimerDurationAsMs)` - Timer duration (ms)

## v2.1.0: Adds "Create Timer" and "Create Message" presets

Implements enhancements to the stagetimer.io API v1:
- New timer endpoints added: `/create_timer`, `/update_timer`, `/delete_timer`
- New timer properties: `start_time`, `start_date`, `finish_time`, `finish_date`, `appearance`, `trigger`, `type`.
- `start_time` and `finish_time` allow setting hard start and finish times for cues, supporting both date and time-based scheduling.
- `appearance`, `trigger`, and `type` properties provide additional control over timer behavior and display.
- New message endpoints added: `/create_message`, `/update_message`, `/delete_message`
- Enhanced flexibility in message management with the updated `/hide_message` endpoint, allowing hiding messages without specific arguments.
- Full API documentation: https://stagetimer.io/docs/api-v1/
- Full companion module documentation: https://stagetimer.io/docs/integration-with-streamdeck-companion/

## v2.0.0 (2023-07-05)

New Stagetimer.io module for Companion, rewritten from scratch for Companion v3.
Uses the new Stagetimer.io API v1.

## 1.0.0 (2021-11-16)
## v1.0.0 (2021-11-16)

Initial version of Stagetimer.io module for Companion.
2 changes: 1 addition & 1 deletion companion/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "stagetimer",
"shortname": "stagetimer",
"description": "Stagetimer.io module for Companion v3",
"version": "2.2.0",
"version": "2.2.1",
"license": "MIT",
"repository": "git+https://github.com/bitfocus/companion-module-stagetimerio-api.git",
"bugs": "https://github.com/bitfocus/companion-module-stagetimerio-api/issues",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stagetimerio-api",
"version": "2.2",
"version": "2.2.1",
"description": "Stagetimer.io module for Companion v3",
"main": "src/index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createDropdownOptions } from './utils.js'

// Regular Expressions for validation
const roomIdRegExp = /^[123456789ABCDEFGHJKLMNPQRSTUVWXYZ]{8}$/
const roomIdRegExp = /^[A-Z0-9]{8}$/
const apiKeyRegExp = /^[a-f0-9-]{32}$/
const apiUrlRegExp = /^https?:\/\/.*(\/v1\/)$/

Expand Down
16 changes: 10 additions & 6 deletions src/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export function socketStart (instance) {
//

socket.on(stagetimerEvents.playback_status, (payload) => {
instance.log('debug', 'Event: playback_status')
instance.log('debug', `Event: 'playback_status' ${JSON.stringify(payload)}`)

const { timer_id, running, start, finish, pause, server_time } = payload

Expand All @@ -203,7 +203,7 @@ export function socketStart (instance) {
})

socket.on(stagetimerEvents.room, (payload) => {
instance.log('debug', 'Event: room')
instance.log('debug', `Event: 'room' ${JSON.stringify(payload)}`)

const { blackout, focus_message, timezone } = payload

Expand All @@ -215,7 +215,9 @@ export function socketStart (instance) {
})

socket.on(stagetimerEvents.current_timer, (payload) => {
instance.log('debug', 'Event: current_timer')
instance.log('debug', `Event: 'current_timer' ${JSON.stringify(payload)}`)

if (!payload) return updateCurrentTimerState.call(instance, {})

const {
_id,
Expand Down Expand Up @@ -245,7 +247,9 @@ export function socketStart (instance) {
})

socket.on(stagetimerEvents.next_timer, (payload) => {
instance.log('debug', 'Event: next_timer')
instance.log('debug', `Event: 'next_timer' ${JSON.stringify(payload)}`)

if (!payload) return updateNextTimerState.call(instance, {})

const {
_id,
Expand Down Expand Up @@ -275,7 +279,7 @@ export function socketStart (instance) {
})

socket.on(stagetimerEvents.message, (payload) => {
instance.log('debug', 'Event: message')
instance.log('debug', `Event: 'message' ${JSON.stringify(payload)}`)

const { showing, text, color, bold, uppercase } = payload

Expand All @@ -289,7 +293,7 @@ export function socketStart (instance) {
})

socket.on(stagetimerEvents.flash, (payload) => {
instance.log('debug', 'Event: flash')
instance.log('debug', `Event: 'flash' ${JSON.stringify(payload)}`)

const { count } = payload

Expand Down
6 changes: 0 additions & 6 deletions src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ export function updateRoomState (newState) {

const isTimezoneChange = updatedState.roomTimezone !== instance.state.room.roomTimezone

instance.log('debug', `room: ${JSON.stringify(updatedState)}`)

instance.state.room = updatedState

instance.setVariableValues({
Expand Down Expand Up @@ -224,8 +222,6 @@ export function updateCurrentTimerState (newState) {

const isAppearanceChange = updatedState.appearance !== instance.state.current_timer.appearance

instance.log('debug', `current_timer: ${JSON.stringify(updatedState)}`)

instance.state.current_timer = updatedState

// Update `phase` using `playback_status` and `timer` state
Expand Down Expand Up @@ -275,8 +271,6 @@ export function updateNextTimerState (newState) {
...newState,
}

instance.log('debug', `next_timer: ${JSON.stringify(updatedState)}`)

instance.state.next_timer = updatedState

const timezone = instance.state.room?.roomTimezone || 'UTC'
Expand Down

0 comments on commit 099cd4c

Please sign in to comment.