struct PlaceOS::Model::Playlist::Schedule

Included Modules

Defined in:

placeos-models/playlist/schedule.cr

Constant Summary

MAX_MASK_SIZE = 128
PLAY_AT_LOCAL_FORMAT = "%Y-%m-%dT%H:%M:%S"
PLAY_AT_LOCAL_REGEX = /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\z/

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(play_cron : String = "0 0 * * *", play_period : Int32 = 1440, play_takeover : Bool = false, play_at : Int64 | Nil = nil, play_at_local : String | Nil = nil, valid_until : Int64 | Nil = nil, valid_from : Int64 | Nil = nil, mask : String | Nil = nil) #

[View source]

Instance Method Detail

def mask : String | Nil #

bitmask on schedule, requires a valid from date if mask.size > 0 then valid_from is required and mask is considered active max mask size is 128 and string can only contain 0's and 1's


[View source]
def play_at : Int64 | Nil #

a one-off play time, either as a unix epoch (#play_at) or as a wall-clock time in the display's local timezone (#play_at_local, an ISO 8601 string with no offset, e.g. "2027-01-01T00:00:00"). These are mutually exclusive.


[View source]
def play_at_local : String | Nil #

[View source]
def play_cron : String #

[View source]
def play_period : Int32 #

[View source]
def play_takeover : Bool #

[View source]
def valid? : Bool #

[View source]
def valid_from : Int64 | Nil #

[View source]
def valid_until : Int64 | Nil #

[View source]
def validation_message : String | Nil #

nil when the schedule is valid, otherwise a human-readable reason.


[View source]