LampScheduleCore 物料

小程序开发相关产品技术讨论,包括面板、智能小程序、React Native、Ray跨端框架、Panel SDK、微信小程序、小程序开发工具(IDE)及其他开发技术相关等话题


Post Reply
Loolluke0617
Posts: 10

使用版本:"@ray-js/lamp-schedule-core": "1.0.0-beta-3"
问题一:请问 LampScheduleCore 组件有示例demo吗?
问题二:const { dpValue: sleepDpValue, updateDp: updateSleepDpValue } = useSleepDp<TSleepData>();
dp点有数据,但进入页面时sleepDpValue是空的,updateSleepDpValue后才有数据,需要如何初始化?
问题三:updateSleepDpValue方法如何添加回调,确保sleepDpValue是最新的?


Tags:
crisiron
Posts: 250

Re: LampScheduleCore 物料

你是要开发照明产品么?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;
}`

Loolluke0617
Posts: 10

Re: LampScheduleCore 物料

解决了,谢谢。
demo这几个月会有吗?

crisiron
Posts: 250

Re: LampScheduleCore 物料

会有的

Loolluke0617
Posts: 10

Re: LampScheduleCore 物料

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;是起始时间还是结束时间

crisiron
Posts: 250

Re: LampScheduleCore 物料

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;是起始时间还是结束时间

起始时间

crisiron
Posts: 250

Re: LampScheduleCore 物料

由于长时间没有回复,先关闭当前问题,如有问题可继续提问

Loolluke0617
Posts: 10

Re: LampScheduleCore 物料

云定时添加冲突时如果不加入timerId则冲突列表中id:"timer_undefined",但自定义timerId再重新getTimerList()后与云定时自动生成的timerId不同,这时冲突列表删除不掉自定义timerId的对象。有没有清空某个type的冲突列表的方法,我可以清空后重新init。目前需要退出面板再返回,冲突列表才能清空。

Attachments
企业微信20251229-192358.png
企业微信20251229-190546.png
企业微信20251229-192301.png
crisiron
Posts: 250

Re: LampScheduleCore 物料

是这么用的 // 定时器创建成功后,更新 Conflict 系统中的数据
// 因为添加时 _timer 没有 timerId,现在 newTimer 有了,需要同步更新
Conflict.remove(res); // 移除没有 timerId 的
Conflict.add({
type: EScheduleFunctionType.TIMER,
detail: [newTimer], // 添加有 timerId 的
});

Loolluke0617
Posts: 10

Re: LampScheduleCore 物料

好的 谢谢
还是希望demo可以早点出

Post Reply