stuartcolman wrote:Some of my devices which have the battery at zero are still showing. Is there a way to filter certain devices out?
There sure is, but I wouldn't want to make it a part of the "official" script because I think a lot of users would want battery devices with 0 to show up. Here is one way. The script creates a list of device names (technically it's called a dictionary) that looks like this:
- Code: Select all
device_dict = {"Device Name 1": 100, "Device Name 2": 75, "Device Name 3": 0}
Just above the line in the script that looks like this:
- Code: Select all
# Parse the battery device dict into X and Y values
You'll want to add this:
- Code: Select all
device_dict.pop("Name of Device You Want to Remove")
device_dict.pop("Name of Another Device You Want to Remove")
And repeat for each device you want to hide. This is completely inelegant because you'll have to go back and add new devices later when you add them to your system--and if you change a device's name the script will break, but it should work for you now right out of the gate.
Dave
p.s. I'll add a TODO to change the script to work with device IDs instead of names to fix the second problem.