e95c50c7429d9111188f79e9f20013a93dc1bf31,homeassistant/components/sensor/transmission.py,,setup_platform,#Any#Any#Any#Any#,50
Before Change
name = config.get(CONF_NAME)
host = config.get(CONF_HOST)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
port = config.get(CONF_PORT)
try:
transmission = transmissionrpc.Client(
host, port=port, user=username, password=password)
transmission_api = TransmissionData(transmission)
except TransmissionError as error:
if str(error).find("401: Unauthorized"):
_LOGGER.error("Credentials for Transmission client are not valid")
return
After Change
def setup_platform(hass, config, add_entities, discovery_info=None):
Set up the Transmission sensors.
if discovery_info is None:
return
transmission_api = hass.data[DATA_TRANSMISSION]
monitored_variables = discovery_info["sensors"]
name = discovery_info["client_name"]
dev = []
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: home-assistant/home-assistant
Commit Name: e95c50c7429d9111188f79e9f20013a93dc1bf31
Time: 2019-01-29
Author: MatteGary@users.noreply.github.com
File Name: homeassistant/components/sensor/transmission.py
Class Name:
Method Name: setup_platform
Project Name: home-assistant/home-assistant
Commit Name: e95c50c7429d9111188f79e9f20013a93dc1bf31
Time: 2019-01-29
Author: MatteGary@users.noreply.github.com
File Name: homeassistant/components/switch/transmission.py
Class Name:
Method Name: setup_platform
Project Name: home-assistant/home-assistant
Commit Name: ced3cd2616332af50bf9a8a4a7241aae017c34e8
Time: 2017-03-16
Author: mezz@johnmihalic.com
File Name: homeassistant/components/sensor/neurio_energy.py
Class Name: NeurioEnergy
Method Name: update