GameDevHobby / Domoticz-LGTV-WebOS-Plugin

LG TV WebOS 3 Plugin for Domoticz
14 stars 13 forks source link

Volume return with 0 #15

Closed DJJo14 closed 5 years ago

DJJo14 commented 5 years ago

On my LG UH610V the volume is always 0. it looks like you had the same problem when i see the commands at line 364 of plugin.py

        output = self.run("get-volume")#.replace("\\n'", "").replace("'", "").replace("b", "")
        # Check if output is a digit instead of garbage
        if not str(output).isdigit():
            output = 0

but it is python so do this:

        output = self.run("get-volume")#.replace("\\n'", "").replace("'", "").replace("b", "")
        Domoticz.Debug("Volumeraw: " + str(output))
        # Check if output is a digit instead of garbage
        try:
            output = int(output)
        except ValueError:
            output = 0
raptile commented 5 years ago

This solved the problem for me. Thanks

GameDevHobby commented 5 years ago

I've made these changes.