Page 1 of 1
LampScheduleCore 物料
Posted: 2025年 Aug 6日 19:26
by Loolluke0617
使用版本:"@ray-js/lamp-schedule-core": "1.0.0-beta-3"
问题一:请问 LampScheduleCore 组件有示例demo吗?
问题二:const { dpValue: sleepDpValue, updateDp: updateSleepDpValue } = useSleepDp<TSleepData>();
dp点有数据,但进入页面时sleepDpValue是空的,updateSleepDpValue后才有数据,需要如何初始化?
问题三:updateSleepDpValue方法如何添加回调,确保sleepDpValue是最新的?
Re: LampScheduleCore 物料
Posted: 2025年 Aug 7日 09:28
by crisiron
你是要开发照明产品么?1. demo 还没提供;2. 进入 node_modules/@ray-js/lamp-schedule-core/lib/hooks/useSleepSupport.js 中添加 console 看看是否有更新; 3. 不用关注内部自定监听 dp 进行更新;按照文档在进入定时页面进行初始化即可
`// 初始化计划模块能力,由于是异步获取,所以需要等待isReady为true后再使用
const { isReady } = useScheduleInit({
devId: deviceId,
groupId,
});
if (!isReady) {
return null;
}`
Re: LampScheduleCore 物料
Posted: 2025年 Aug 7日 15:14
by Loolluke0617
Re: LampScheduleCore 物料
Posted: 2025年 Aug 7日 15:39
by crisiron
Re: LampScheduleCore 物料
Posted: 2025年 Aug 7日 17:04
by Loolluke0617
export interface TSleepNode {
onOff: boolean;
loops: string;
step: number;
hour: number;
minute: number;
hue: number;
saturation: number;
value: number;
brightness: number;
temperature: number;
index: number;
time?: string;
}
请问time?: string;是起始时间还是结束时间
Re: LampScheduleCore 物料
Posted: 2025年 Aug 12日 09:15
by crisiron
Loolluke0617 2025年 Aug 7日 17:04
export interface TSleepNode {
onOff: boolean;
loops: string;
step: number;
hour: number;
minute: number;
hue: number;
saturation: number;
value: number;
brightness: number;
temperature: number;
index: number;
time?: string;
}
请问time?: string;是起始时间还是结束时间
起始时间
Re: LampScheduleCore 物料
Posted: 2025年 Aug 22日 15:00
by crisiron
由于长时间没有回复,先关闭当前问题,如有问题可继续提问
Re: LampScheduleCore 物料
Posted: 2025年 Dec 29日 19:28
by Loolluke0617
云定时添加冲突时如果不加入timerId则冲突列表中id:"timer_undefined",但自定义timerId再重新getTimerList()后与云定时自动生成的timerId不同,这时冲突列表删除不掉自定义timerId的对象。有没有清空某个type的冲突列表的方法,我可以清空后重新init。目前需要退出面板再返回,冲突列表才能清空。
Re: LampScheduleCore 物料
Posted: 2025年 Dec 29日 19:48
by crisiron
是这么用的 // 定时器创建成功后,更新 Conflict 系统中的数据
// 因为添加时 _timer 没有 timerId,现在 newTimer 有了,需要同步更新
Conflict.remove(res); // 移除没有 timerId 的
Conflict.add({
type: EScheduleFunctionType.TIMER,
detail: [newTimer], // 添加有 timerId 的
});
Re: LampScheduleCore 物料
Posted: 2025年 Dec 30日 10:43
by Loolluke0617