Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【求助】增加风速(音量)调节功能 #131

Closed
wants to merge 2 commits into from

Conversation

nkh0472
Copy link
Contributor

@nkh0472 nkh0472 commented May 28, 2021

试图解决#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,简单地用计时器让音量从初始值慢慢变小就可以……

@vercel
Copy link

vercel bot commented May 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/yunyoujun/air-conditioner/C8tcrdmX1Z4UyjxJX1bEi1U9Vyf6
✅ Preview: Failed

@nkh0472 nkh0472 marked this pull request as draft May 28, 2021 03:31
@nkh0472 nkh0472 changed the title 增加风速(音量)调节功能 【求助】增加风速(音量)调节功能 May 28, 2021
@YunYouJun
Copy link
Owner

目前已经使用 hooks 重构,去除了 Redux 的臃肿状态管理。

建议:

可以发起 Issue,像本 PR 部分说明计划功能和关联内容。
分为多个 PR 实现计划中可独立运行的功能。我会对其 Review 和修改。

当前 PR 就先关闭了。

@YunYouJun YunYouJun closed this Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants