Skip to content

Battery Reporting - Petsafe-Smart-Door.Groovy #8

@mpark12345

Description

@mpark12345

Hi,
I realize this is ancient, and I appreciate you making it. It has worked great over the years.

There has been some change resulting in the battery reporting as 0% all the time.
I found if you change the 2 lines: (126,127)

def pct = (volts - minVolts) / (maxVolts - minVolts)
result.value = Math.min(100, (int) pct * 100)

to:

def pct = (((volts - minVolts) / (maxVolts - minVolts)) * 100)
result.value = Math.min(100, (int) pct)

It corrects the problem. At least currently. (10/25/2018)

Thanks again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions