Index signature for dynamic property access
Hook called after setting schedule list - for customization
Hook called before setting schedule list - for customization
Observable map of schedules indexed by schedule ID
Returns an array of all schedules in the store This computed property provides a reactive list view of all schedules
Array of all schedules in the store
Provides access to the schedule map indexed by schedule IDs This computed property ensures reactive access to the schedule store
Map of schedules indexed by their IDs
Setter for schedules indexed by ID
Map of schedules to set
Dynamically adds an observable property to the store
This method adds a new observable property to the store and automatically creates getter and setter methods for it. The property name is capitalized for the getter/setter methods.
The name of the property to add
The initial value for the property
Creates a new schedule with the provided configuration
This action method:
Partial schedule configuration
Created and initialized schedule instance
// Create a daily morning schedule
const schedule = await scheduleStore.createSchedule({
name: 'Morning Routine',
nodes: ['bedroom_light', 'kitchen_light'],
action: {
bedroom_light: { light: { power: true, brightness: 60 } },
kitchen_light: { light: { power: true, brightness: 100 } }
},
triggers: [{ m: 420, d: 127 }], // 7:00 AM every day
info: 'Automated morning lighting'
});
Enables a schedule by its ID
This action method activates a schedule, allowing it to execute according to its triggers. The change is synchronized across all nodes associated with the schedule.
ID of the schedule to enable
Determines if a schedule's configuration is synchronized with given schedule data This method performs deep comparison of schedule properties to detect any differences
The existing schedule instance to compare
New schedule data to compare against
Array of property keys to compare (e.g., ['name', 'enabled', 'triggers'])
Sync status and any out-of-sync metadata
// Check if schedule is in sync
const { isInSync, meta } = scheduleStore.isScheduleInSync(
existingSchedule,
newScheduleData,
['name', 'enabled', 'triggers']
);
if (!isInSync) {
console.log('Out of sync properties:', meta);
// Handle out of sync state
existingSchedule.addOutOfSyncMeta(nodeId, meta);
}
Synchronizes schedules from specified nodes
This action method:
Array of node IDs to sync schedules from
ScheduleStore - Manages schedule operations and state for ESP Rainmaker CDF
This store is responsible for managing schedules across multiple nodes in the ESP Rainmaker system. It provides a centralized way to handle schedule operations, state management, and node synchronization.
Key Features:
ScheduleStore
Implements