ecc249aa27a8177ba2a9050465fd35319f7e1b24,homeassistant/components/sensor/usps.py,,setup_platform,#Any#Any#Any#Any#,38
Before Change
def setup_platform(hass, config, add_devices, discovery_info=None):
Setup the USPS platform.
import myusps
try:
cookie = hass.config.path(COOKIE)
session = myusps.get_session(
config.get(CONF_USERNAME), config.get(CONF_PASSWORD),
cookie_path=cookie)
except myusps.USPSError:
_LOGGER.exception("Could not connect to My USPS")
return False
add_devices([USPSPackageSensor(session, config.get(CONF_NAME)),
USPSMailSensor(session, config.get(CONF_NAME))], True)
After Change
return
usps = hass.data[DATA_USPS]
add_devices([USPSPackageSensor(usps),
USPSMailSensor(usps)], True)
class USPSPackageSensor(Entity):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: home-assistant/home-assistant
Commit Name: ecc249aa27a8177ba2a9050465fd35319f7e1b24
Time: 2017-08-18
Author: mezz@johnmihalic.com
File Name: homeassistant/components/sensor/usps.py
Class Name:
Method Name: setup_platform
Project Name: deepgram/kur
Commit Name: f9e27737834aa42092518755743a26a4785e198c
Time: 2017-01-31
Author: ajsyp@syptech.net
File Name: kur/providers/batch_provider.py
Class Name: BatchProvider
Method Name: __iter__
Project Name: home-assistant/home-assistant
Commit Name: 35f0270688d2bd1e31e45ebbc1771f1ff940bff6
Time: 2015-07-16
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/sun.py
Class Name:
Method Name: setup