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

battery widget complains nil value of 'rate' when on battery #45

Closed
lovelock opened this issue Apr 25, 2014 · 5 comments
Closed

battery widget complains nil value of 'rate' when on battery #45

lovelock opened this issue Apr 25, 2014 · 5 comments

Comments

@lovelock
Copy link

2014-04-26-003050_1920x1080_scrot
Hi, thanks for your gorgeous work, but there is a problem with me, when on battery it will continually complain that 'rate' is a 'nil value' which is on line 72 in lain/widgets/bat.lua, I tried modify the block like this

elseif bat_now.status == 'Discharing'
then
    rate = 1
    time_rate = rem / rate
end

it doesn't complai any more, but I have no idea what value it shoud be, because obviously it is not 1.
Thank you.

@lcpz
Copy link
Owner

lcpz commented Apr 29, 2014

It seems you have an old commit. Update and try again.

@lovelock
Copy link
Author

Yeah, I've got that, you set it to 1 too, 😁

王青春

-----原始邮件-----
发件人: "Luke Bonham" notifications@github.com
发送时间: ‎2014/‎4/‎29 18:56
收件人: "copycat-killer/lain" lain@noreply.github.com
抄送: "Frost Wong" frostwong@gmail.com
主题: Re: [lain] battery widget complains nil value of 'rate' when onbattery (#45)

It seems you have an old commit. Update and try again.

Reply to this email directly or view it on GitHub.

@lcpz
Copy link
Owner

lcpz commented Apr 29, 2014

Do you have /sys/class/power_supply/YOURBAT/current_now or power_now?

If not, tell me if you have an equivalent file.

@lovelock
Copy link
Author

I have power_now in it.

王青春

-----原始邮件-----
发件人: "Luke Bonham" notifications@github.com
发送时间: ‎2014/‎4/‎29 21:29
收件人: "copycat-killer/lain" lain@noreply.github.com
抄送: "Frost Wong" frostwong@gmail.com
主题: Re: [lain] battery widget complains nil value of 'rate' when onbattery (#45)

Do you have /sys/class/power_supply/YOURBAT/current_now or power_now?
If not, tell me if you have an equivalent file.

Reply to this email directly or view it on GitHub.

@lcpz
Copy link
Owner

lcpz commented Apr 30, 2014

Then it's already fixed.

You'll never reach that 1, which is a last patch to avoid showing errors like this.

@lcpz lcpz closed this as completed Apr 30, 2014
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

No branches or pull requests

2 participants