4a421e25b08f453feba08ad78c4865c2abcc4790,homeassistant/components/sensor/rest.py,,setup_platform,#Any#Any#Any#Any#,27
Before Change
try:
if use_get:
response = requests.get(resource, timeout=10, verify=verify_ssl)
elif use_post:
response = requests.post(resource, data=payload, timeout=10,
verify=verify_ssl)
if not response.ok:
_LOGGER.error("Response status is "%s"", response.status_code)
return False
except requests.exceptions.MissingSchema:
After Change
rest = RestData(method, resource, payload, verify_ssl)
rest.update()
if rest.data is None:
_LOGGER.error("Unable to fetch Rest data")
return False
add_devices([RestSensor(
hass, rest, config.get("name", DEFAULT_NAME),
config.get("unit_of_measurement"), config.get(CONF_VALUE_TEMPLATE))])
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: home-assistant/home-assistant
Commit Name: 4a421e25b08f453feba08ad78c4865c2abcc4790
Time: 2016-01-02
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/sensor/rest.py
Class Name:
Method Name: setup_platform
Project Name: home-assistant/home-assistant
Commit Name: 4a421e25b08f453feba08ad78c4865c2abcc4790
Time: 2016-01-02
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/binary_sensor/rest.py
Class Name:
Method Name: setup_platform
Project Name: analysiscenter/batchflow
Commit Name: 0c573dda88e351090519b6410e8fa53e05ff1250
Time: 2018-03-30
Author: a.kozhevin@analysiscenter.ru
File Name: dataset/research/workers.py
Class Name: PipelineWorker
Method Name: run_task