Update for new pyvesyncv_v2 library and vesync switch support (#21449)
* Change dependency to pyvesync-v2 for vesync switch * Update requirements_all.txt * Update Version - Wall Switch Support Update required version for vesync outlets and switches. Eliminate API call for energy usage for wall switches that do not have that feature * fix name convention
This commit is contained in:
parent
1ad4779443
commit
61e4a6be18
2 changed files with 6 additions and 5 deletions
|
@ -11,7 +11,7 @@ from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD)
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
|
||||
REQUIREMENTS = ['pyvesync==0.1.1']
|
||||
REQUIREMENTS = ['pyvesync_v2==0.9.6']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -23,7 +23,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the VeSync switch platform."""
|
||||
from pyvesync.vesync import VeSync
|
||||
from pyvesync_v2.vesync import VeSync
|
||||
|
||||
switches = []
|
||||
|
||||
|
@ -104,5 +104,6 @@ class VeSyncSwitchHA(SwitchDevice):
|
|||
def update(self):
|
||||
"""Handle data changes for node values."""
|
||||
self.smartplug.update()
|
||||
self._current_power_w = self.smartplug.get_power()
|
||||
self._today_energy_kwh = self.smartplug.get_kwh_today()
|
||||
if self.smartplug.devtype == 'outlet':
|
||||
self._current_power_w = self.smartplug.get_power()
|
||||
self._today_energy_kwh = self.smartplug.get_kwh_today()
|
||||
|
|
|
@ -1439,7 +1439,7 @@ pyuptimerobot==0.0.5
|
|||
pyvera==0.2.45
|
||||
|
||||
# homeassistant.components.switch.vesync
|
||||
pyvesync==0.1.1
|
||||
pyvesync_v2==0.9.6
|
||||
|
||||
# homeassistant.components.media_player.vizio
|
||||
pyvizio==0.0.4
|
||||
|
|
Loading…
Add table
Reference in a new issue