Add encoding configuration setting to REST and Scape (#90254)

* Create new config parameter for default character encoding if no character encoding is declared

* Changes suggested by gjohansson-ST

* Added config flow for scape

* Removed "character"

* Change to create_async_httpx_client

* Remove CONF_ENCODING from Scrape SENSOR_SCHEMA

* Debug scrape test
This commit is contained in:
Olivier Ouellet 2023-03-28 06:42:31 -04:00 committed by GitHub
parent 3c3860c923
commit 1c465b5ad0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 67 additions and 12 deletions

View file

@ -33,8 +33,10 @@ from homeassistant.helpers.template_entity import (
)
from .const import (
CONF_ENCODING,
CONF_JSON_ATTRS,
CONF_JSON_ATTRS_PATH,
DEFAULT_ENCODING,
DEFAULT_FORCE_UPDATE,
DEFAULT_METHOD,
DEFAULT_VERIFY_SSL,
@ -57,6 +59,7 @@ RESOURCE_SCHEMA = {
vol.Optional(CONF_PAYLOAD): cv.string,
vol.Optional(CONF_VERIFY_SSL, default=DEFAULT_VERIFY_SSL): cv.boolean,
vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
vol.Optional(CONF_ENCODING, default=DEFAULT_ENCODING): cv.string,
}
SENSOR_SCHEMA = {