mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Add mychevy optional country parameter (#19727)
* Add optional country parameter mychevy 1.2.0 provides the ability to work in canada as well as the us (there are different service urls for each region). This creates a new config option to enable it. * Update mychevy.py
This commit is contained in:
parent
dbb3802b4e
commit
03488af3fb
@ -16,7 +16,7 @@ from homeassistant.helpers import config_validation as cv
|
|||||||
from homeassistant.helpers import discovery
|
from homeassistant.helpers import discovery
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
REQUIREMENTS = ["mychevy==1.1.0"]
|
REQUIREMENTS = ["mychevy==1.2.0"]
|
||||||
|
|
||||||
DOMAIN = 'mychevy'
|
DOMAIN = 'mychevy'
|
||||||
UPDATE_TOPIC = DOMAIN
|
UPDATE_TOPIC = DOMAIN
|
||||||
@ -33,10 +33,15 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=30)
|
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=30)
|
||||||
ERROR_SLEEP_TIME = timedelta(minutes=30)
|
ERROR_SLEEP_TIME = timedelta(minutes=30)
|
||||||
|
|
||||||
|
CONF_COUNTRY = 'country'
|
||||||
|
DEFAULT_COUNTRY = 'us'
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema({
|
CONFIG_SCHEMA = vol.Schema({
|
||||||
DOMAIN: vol.Schema({
|
DOMAIN: vol.Schema({
|
||||||
vol.Required(CONF_USERNAME): cv.string,
|
vol.Required(CONF_USERNAME): cv.string,
|
||||||
vol.Required(CONF_PASSWORD): cv.string,
|
vol.Required(CONF_PASSWORD): cv.string,
|
||||||
|
vol.Optional(CONF_COUNTRY, default=DEFAULT_COUNTRY):
|
||||||
|
vol.All(cv.string, vol.In(['us', 'ca']))
|
||||||
}),
|
}),
|
||||||
}, extra=vol.ALLOW_EXTRA)
|
}, extra=vol.ALLOW_EXTRA)
|
||||||
|
|
||||||
@ -72,7 +77,8 @@ def setup(hass, base_config):
|
|||||||
|
|
||||||
email = config.get(CONF_USERNAME)
|
email = config.get(CONF_USERNAME)
|
||||||
password = config.get(CONF_PASSWORD)
|
password = config.get(CONF_PASSWORD)
|
||||||
hass.data[DOMAIN] = MyChevyHub(mc.MyChevy(email, password), hass,
|
country = config.get(CONF_COUNTRY)
|
||||||
|
hass.data[DOMAIN] = MyChevyHub(mc.MyChevy(email, password, country), hass,
|
||||||
base_config)
|
base_config)
|
||||||
hass.data[DOMAIN].start()
|
hass.data[DOMAIN].start()
|
||||||
|
|
||||||
|
@ -680,7 +680,7 @@ motorparts==1.0.2
|
|||||||
mutagen==1.41.1
|
mutagen==1.41.1
|
||||||
|
|
||||||
# homeassistant.components.mychevy
|
# homeassistant.components.mychevy
|
||||||
mychevy==1.1.0
|
mychevy==1.2.0
|
||||||
|
|
||||||
# homeassistant.components.mycroft
|
# homeassistant.components.mycroft
|
||||||
mycroftapi==2.0
|
mycroftapi==2.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user