-
-
Notifications
You must be signed in to change notification settings - Fork 36.8k
Add Dominos Pizza platform #10379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dominos Pizza platform #10379
Changes from 1 commit
3bca66e
b4c34c2
6a3813b
4faf97d
64adc01
27d63a9
b536647
18bbbca
2793808
a1ba981
2b9749f
456a1c4
fe574e6
03ad3ac
646cebc
c5f70d2
fd90800
c59fe34
bd1f914
7838ceb
f0d70ae
a6c0ca6
cffcd13
53f4acc
33e6062
db75ffb
ca1a115
28542ae
3172f43
fc9808d
810a248
6c049cb
b9815f1
483934d
81f7d10
0c1c81e
c91b719
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,9 +21,8 @@ | |
| ATTR_DUMP_MENU = 'dump_menu' | ||
| ATTR_ORDER_ENTITY = 'order_entity_id' | ||
|
|
||
| DEFAULT_NAME = 'World' | ||
|
|
||
| REQUIREMENTS = ['pizzapi', 'jsonpickle'] | ||
| COMMIT = 'ae140bd640d64ce5fdb638d5b11cfc8dae6c6587' | ||
| REQUIREMENTS = ['https://github.com/wardcraigj/pizzapi/archive/%s.zip#pizzapi==0.0.2' % COMMIT, 'jsonpickle'] | ||
|
|
||
| CONFIG_SCHEMA = vol.Schema({ | ||
| DOMAIN: vol.Schema({ | ||
|
|
@@ -41,15 +40,15 @@ | |
|
|
||
| def setup(hass, config): | ||
| """Set up is called when Home Assistant is loading our component.""" | ||
| dominos = Dominos(hass, config) | ||
|
|
||
|
|
||
| # if config[DOMAIN].get(ATTR_DUMP_MENU): | ||
| # hass.states.set('dominos.closest_menu', jsonpickle.encode(store.get_menu())) | ||
| if config[DOMAIN].get(ATTR_DUMP_MENU): | ||
|
||
| hass.states.set('dominos.closest_menu', jsonpickle.encode(dominos.store.get_menu())) | ||
|
|
||
| for order in config[DOMAIN].get(ATTR_ORDERS): | ||
| # _LOGGER.INFO('Creating Order') | ||
|
||
| hass.states.set('dominos.' + order['name'].replace(" ", "_"), json.dumps(order['codes'])) | ||
| hass.services.register(DOMAIN, 'order', Dominos(hass, config)._handle_order) | ||
| hass.services.register(DOMAIN, 'order', dominos.handle_order) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a schema for validating the service data. |
||
|
|
||
|
|
||
| # Return boolean to indicate that initialization was successfully. | ||
|
|
@@ -65,7 +64,7 @@ def __init__(self, hass, config): | |
| self.store = self.address.closest_store() | ||
| self.country = config[DOMAIN].get(ATTR_COUNTRY) | ||
|
|
||
| def _handle_order(self, call=None): | ||
| def handle_order(self, call=None): | ||
| """Handle ordering pizza.""" | ||
|
|
||
| order_key = call.data.get(ATTR_ORDER_ENTITY) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be a config option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, no problem. Would it be preferable to perform this dump via a service call?