Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
试图解决#26 #29
有一说一,纯小白……所以后面的不会写了,就完全交给作者大大了吧……
姑且写了/src/features/ac/acSlice.ts里的
acItemKey.speed
这个值,储存的是0.0~1.0的number;并做出来了
decreaseSpeed
,increaseSpeed
两个函数,给前面的值加减0.25;原先调节温度的函数进行了更名,
increment
-->incrementTemp``decrement
-->decrementTemp
。根据HTMLMediaElement.volume - Web APIs | MDN的说法,似乎调节风速的话,只需要给/src/components/RemoteControl.tsx里的
acWork.volume
赋值为前面的acItemKey.speed
就可以,但是不知道怎么在两个文件之间传递值……ToDo:
要实现变频的话,就不再是直接让
acWork.volume
等于acItemKey.speed
,而是要做出一个函数算出来合适的风速SetActualSpeed(acItemKey.actualTemp, acItemKey.speed){let acWork.volume=……}
,想一想如果前面的功能都实现了的话,这一步似乎不算复杂……或者再退一步,变成伪变频空调,不需要
actualTemp
,简单地用计时器让音量从初始值慢慢变小就可以……