-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
120 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,36 @@ | ||
"""Config flow for Meridian Energy integration.""" | ||
|
||
from homeassistant import config_entries | ||
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD | ||
import homeassistant.helpers.config_validation as cv | ||
import voluptuous as vol | ||
|
||
from .const import ( | ||
DOMAIN, | ||
SENSOR_NAME | ||
) | ||
from .const import DOMAIN, SENSOR_NAME | ||
|
||
|
||
@config_entries.HANDLERS.register(DOMAIN) | ||
class MeridianConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): | ||
"""Define the config flow.""" | ||
|
||
VERSION = 1 | ||
|
||
async def async_step_user(self, user_input=None): | ||
"""Show user form""" | ||
if user_input is not None: | ||
return self.async_create_entry( | ||
title=SENSOR_NAME, | ||
data={ | ||
CONF_EMAIL: user_input[CONF_EMAIL], | ||
CONF_PASSWORD: user_input[CONF_PASSWORD] | ||
} | ||
CONF_PASSWORD: user_input[CONF_PASSWORD], | ||
}, | ||
) | ||
|
||
return self.async_show_form( | ||
step_id="user", | ||
data_schema=vol.Schema({ | ||
vol.Required(CONF_EMAIL): cv.string, | ||
vol.Required(CONF_PASSWORD): cv.string | ||
}) | ||
) | ||
data_schema=vol.Schema( | ||
{ | ||
vol.Required(CONF_EMAIL): cv.string, | ||
vol.Required(CONF_PASSWORD): cv.string, | ||
} | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
"""Constants for the Meridian Energy sensors""" | ||
"""Constants for the Meridian Energy sensors.""" | ||
|
||
from homeassistant.const import Platform | ||
|
||
DOMAIN = 'meridian_energy' | ||
SENSOR_NAME = 'Meridian Energy' | ||
DOMAIN = "meridian_energy" | ||
SENSOR_NAME = "Meridian Energy" | ||
|
||
PLATFORMS = [ | ||
Platform.SENSOR, | ||
] | ||
] |
Oops, something went wrong.