Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions homeassistant/components/ihc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""
import logging
import os.path
import xml.etree.ElementTree

import voluptuous as vol

Expand All @@ -24,7 +23,7 @@
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.typing import HomeAssistantType

REQUIREMENTS = ['ihcsdk==2.2.0']
REQUIREMENTS = ['ihcsdk==2.2.0', 'defusedxml==0.5.0']

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -217,11 +216,13 @@ def get_manual_configuration(
def autosetup_ihc_products(hass: HomeAssistantType, config, ihc_controller,
controller_id):
"""Auto setup of IHC products from the IHC project file."""
from defusedxml import ElementTree

project_xml = ihc_controller.get_project()
if not project_xml:
_LOGGER.error("Unable to read project from IHC controller")
return False
project = xml.etree.ElementTree.fromstring(project_xml)
project = ElementTree.fromstring(project_xml)

# if an auto setup file exist in the configuration it will override
yaml_path = hass.config.path(AUTO_SETUP_YAML)
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/namecheapdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.helpers.aiohttp_client import async_get_clientsession

REQUIREMENTS = ['defusedxml==0.5.0']

_LOGGER = logging.getLogger(__name__)

DOMAIN = 'namecheapdns'
Expand Down Expand Up @@ -55,7 +57,7 @@ async def update_domain_interval(now):

async def _update_namecheapdns(session, host, domain, password):
"""Update namecheap DNS entry."""
import xml.etree.ElementTree as ET
import defusedxml.ElementTree as ET

params = {
'host': host,
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/sensor/ohmconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""
import logging
from datetime import timedelta
import xml.etree.ElementTree as ET

import requests
import voluptuous as vol
Expand All @@ -17,6 +16,8 @@
from homeassistant.util import Throttle
from homeassistant.helpers.entity import Entity

REQUIREMENTS = ['defusedxml==0.5.0']

_LOGGER = logging.getLogger(__name__)

CONF_ID = 'id'
Expand Down Expand Up @@ -68,6 +69,8 @@ def device_state_attributes(self):
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
"""Get the latest data from OhmConnect."""
import defusedxml.ElementTree as ET

try:
url = ("https://login.ohmconnect.com"
"/verify-ohm-hour/{}").format(self._ohmid)
Expand Down
3 changes: 3 additions & 0 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ datapoint==0.4.3
# homeassistant.components.light.decora_wifi
# decora_wifi==1.3

# homeassistant.components.ihc
# homeassistant.components.namecheapdns
# homeassistant.components.device_tracker.upc_connect
# homeassistant.components.sensor.ohmconnect
defusedxml==0.5.0

# homeassistant.components.sensor.deluge
Expand Down
3 changes: 3 additions & 0 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ caldav==0.5.0
# homeassistant.components.sensor.coinmarketcap
coinmarketcap==5.0.3

# homeassistant.components.ihc
# homeassistant.components.namecheapdns
# homeassistant.components.device_tracker.upc_connect
# homeassistant.components.sensor.ohmconnect
defusedxml==0.5.0

# homeassistant.components.sensor.dsmr
Expand Down