<commit_before>"""
The chinese stock market price information comes from Aliyun.

by HAChina.io

"""
import logging
import asyncio
import aiohttp
import async_timeout
from datetime import timedelta

import voluptuous as vol

import http.client

import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.aiohttp_client import async_get_clientsession


_LOGGER = logging.getLogger(__name__)

ATTR_OPEN = 'open'
ATTR_PREV_CLOSE = 'prev_close'
ATTR_HIGH = 'high'
ATTR_LOW = 'low'
ATTR_NAME = 'friendly_name'

CONF_ATTRIBUTION = "Chinese stock market information provided by Aliyun"
CONF_SYMBOLS = 'symbols'
CONF_APPCODE = 'appcode'


DEFAULT_SYMBOL = 'sz000002'

ICON = 'mdi:currency-cny'

SCAN_INTERVAL = timedelta(minutes=5)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_SYMBOLS, default=[DEFAULT_SYMBOL]):<commit_msg>Update aliyun_stock.py<commit_after>"""
The chinese stock market price information comes from Aliyun.

by HAChina.io

"""
import logging
import asyncio
from datetime import timedelta

import voluptuous as vol
import http.client

import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.entity import Entity


_LOGGER = logging.getLogger(__name__)

ATTR_OPEN = 'open'
ATTR_PREV_CLOSE = 'prev_close'
ATTR_HIGH = 'high'
ATTR_LOW = 'low'
ATTR_NAME = 'friendly_name'

CONF_ATTRIBUTION = "Chinese stock market information provided by Aliyun"
CONF_SYMBOLS = 'symbols'
CONF_APPCODE = 'appcode'


DEFAULT_SYMBOL = 'sz000002'

ICON = 'mdi:currency-cny'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
    vol.Optional(CONF_SYMBOLS, default=[DEFAULT_SYMBOL]):
{'fraction_non_alphanumeric': 0.0745637228979376, 'fraction_numerical': 0.006874669487043892, 'mean_word_length': 6.568, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1525902', 'n_tokens_mistral': 632, 'n_tokens_neox': 623, 'n_words': 158}