e95c50c7429d9111188f79e9f20013a93dc1bf31,homeassistant/components/sensor/transmission.py,,setup_platform,#Any#Any#Any#Any#,50
Before Change
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
return
transmission_api = hass.data[DATA_TRANSMISSION]
monitored_variables = discovery_info["sensors"]
name = discovery_info["client_name"]
dev = []
for sensor_type in monitored_variables:
dev.append(TransmissionSensor(
sensor_type,
transmission_api,
name,
SENSOR_TYPES[sensor_type][0],
SENSOR_TYPES[sensor_type][1]))
add_entities(dev, True)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
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: GoogleCloudPlatform/python-docs-samples
Commit Name: 7c3bebd23bbf2ac266aa543d73b959e5bcb77068
Time: 2017-07-28
Author: dizcology@hotmail.com
File Name: language/cloud-client/v1beta2/snippets.py
Class Name:
Method Name: syntax_text
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7c3bebd23bbf2ac266aa543d73b959e5bcb77068
Time: 2017-07-28
Author: dizcology@hotmail.com
File Name: language/cloud-client/v1beta2/snippets.py
Class Name:
Method Name: syntax_file