Skip to content

Commit

Permalink
update README and bump version
Browse files Browse the repository at this point in the history
Signed-off-by: CubicPill <[email protected]>
  • Loading branch information
CubicPill committed Sep 18, 2024
1 parent d759741 commit 2794335
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 21 deletions.
48 changes: 40 additions & 8 deletions custom_components/china_southern_power_grid_stat/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,46 @@
from homeassistant.exceptions import ConfigEntryAuthFailed
from requests import RequestException

from .const import (ABORT_ALL_ADDED, ABORT_NO_ACCOUNT, CONF_ACCOUNT_NUMBER, CONF_ACTION, CONF_AUTH_TOKEN,
CONF_ELE_ACCOUNTS, CONF_GENERAL_ERROR, CONF_LOGIN_TYPE, CONF_REFRESH_QR_CODE, CONF_SETTINGS,
CONF_SMS_CODE, CONF_UPDATED_AT, CONF_UPDATE_INTERVAL, DEFAULT_UPDATE_INTERVAL, DOMAIN,
ERROR_CANNOT_CONNECT, ERROR_INVALID_AUTH, ERROR_QR_NOT_SCANNED, ERROR_UNKNOWN,
LOGIN_TYPE_TO_QR_APP_NAME, STEP_ADD_ACCOUNT, STEP_ALI_QR_LOGIN, STEP_CSG_QR_LOGIN, STEP_INIT,
STEP_QR_LOGIN, STEP_SETTINGS, STEP_SMS_LOGIN, STEP_SMS_PWD_LOGIN, STEP_USER, STEP_VALIDATE_SMS_CODE,
STEP_WX_QR_LOGIN)
from .csg_client import (CSGClient, CSGElectricityAccount, InvalidCredentials, LOGIN_TYPE_TO_QR_CODE_TYPE, LoginType)
from .const import (
ABORT_ALL_ADDED,
ABORT_NO_ACCOUNT,
CONF_ACCOUNT_NUMBER,
CONF_ACTION,
CONF_AUTH_TOKEN,
CONF_ELE_ACCOUNTS,
CONF_GENERAL_ERROR,
CONF_LOGIN_TYPE,
CONF_REFRESH_QR_CODE,
CONF_SETTINGS,
CONF_SMS_CODE,
CONF_UPDATE_INTERVAL,
CONF_UPDATED_AT,
DEFAULT_UPDATE_INTERVAL,
DOMAIN,
ERROR_CANNOT_CONNECT,
ERROR_INVALID_AUTH,
ERROR_QR_NOT_SCANNED,
ERROR_UNKNOWN,
LOGIN_TYPE_TO_QR_APP_NAME,
STEP_ADD_ACCOUNT,
STEP_ALI_QR_LOGIN,
STEP_CSG_QR_LOGIN,
STEP_INIT,
STEP_QR_LOGIN,
STEP_SETTINGS,
STEP_SMS_LOGIN,
STEP_SMS_PWD_LOGIN,
STEP_USER,
STEP_VALIDATE_SMS_CODE,
STEP_WX_QR_LOGIN,
)
from .csg_client import (
LOGIN_TYPE_TO_QR_CODE_TYPE,
CSGClient,
CSGElectricityAccount,
InvalidCredentials,
LoginType,
)

_LOGGER = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
import sys
import time

from csg_client import (CSGClient, CSGElectricityAccount, LOGIN_TYPE_TO_QR_CODE_TYPE, LoginType)
from csg_client import (
LOGIN_TYPE_TO_QR_CODE_TYPE,
CSGClient,
CSGElectricityAccount,
LoginType,
)

QR_SCAN_TIMEOUT = 300

Expand Down
17 changes: 14 additions & 3 deletions custom_components/china_southern_power_grid_stat/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,20 @@
SUFFIX_THIS_YEAR_KWH,
SUFFIX_YESTERDAY_KWH,
)
from .csg_client import (CSGAPIError, CSGClient, CSGElectricityAccount, JSON_KEY_METERING_POINT_NUMBER, NotLoggedIn,
WF_ATTR_CHARGE, WF_ATTR_DATE, WF_ATTR_KWH, WF_ATTR_LADDER, WF_ATTR_LADDER_REMAINING_KWH,
WF_ATTR_LADDER_START_DATE, WF_ATTR_LADDER_TARIFF)
from .csg_client import (
JSON_KEY_METERING_POINT_NUMBER,
WF_ATTR_CHARGE,
WF_ATTR_DATE,
WF_ATTR_KWH,
WF_ATTR_LADDER,
WF_ATTR_LADDER_REMAINING_KWH,
WF_ATTR_LADDER_START_DATE,
WF_ATTR_LADDER_TARIFF,
CSGAPIError,
CSGClient,
CSGElectricityAccount,
NotLoggedIn,
)

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 0 additions & 3 deletions custom_components/china_southern_power_grid_stat/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
"add_account": {
"title": "选择缴费号"
},
"remove_account": {
"title": "移除缴费号"
},
"settings": {
"title": "参数设置",
"data": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
"init": {
"title": "\u9009\u62e9\u64cd\u4f5c"
},
"remove_account": {
"title": "\u79fb\u9664\u7f34\u8d39\u53f7"
},
"settings": {
"data": {
"update_interval": "\u66f4\u65b0\u95f4\u9694\uff08\u79d2\uff09"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
"init": {
"title": "\u9009\u62e9\u64cd\u4f5c"
},
"remove_account": {
"title": "\u79fb\u9664\u7f34\u8d39\u53f7"
},
"settings": {
"data": {
"update_interval": "\u66f4\u65b0\u95f4\u9694\uff08\u79d2\uff09"
Expand Down

0 comments on commit 2794335

Please sign in to comment.