Skip to content

Commit

Permalink
Merge branch 'use-sensor-domain'
Browse files Browse the repository at this point in the history
  • Loading branch information
iprak committed Jun 3, 2021
2 parents f072735 + 5cd9e6b commit c4246b2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ yahoofinance:
- ISTNX
```
The above configuration will generate an entity with the id `yahoofinance.istnx` and current value as the state along with these attributes:
The above configuration will generate an entity with the id `sensor.yahoofinance_istnx` and current value as the state along with these attributes:

```
attribution: Data provided by Yahoo Finance
Expand Down Expand Up @@ -133,5 +133,6 @@ The component exposes the service `yahoofinance.refresh_symbols` which can be us

# Breaking Changes

- As of version [1.1.0](https://github.com/iprak/yahoofinance/releases/), the entity id has changed from `yahoofinance.symbol` to `sensor.yahoofinance_symbol`.
- As of version 1.0.0, all the configuration is now under `yahoofinance`. If you are upgrading from an older version, then you would need to adjust the configuration.
- As of version 1.0.1, the minimum `scan_interval` is 30 seconds.
2 changes: 1 addition & 1 deletion custom_components/yahoofinance/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"@iprak"
],
"issue_tracker": "https://github.com/iprak/yahoofinance/issues",
"version": "1.0.11"
"version": "1.1.0"
}
3 changes: 2 additions & 1 deletion custom_components/yahoofinance/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
from timeit import default_timer as timer

from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.helpers.entity import Entity, async_generate_entity_id

Expand Down Expand Up @@ -41,7 +42,7 @@
)

_LOGGER = logging.getLogger(__name__)
ENTITY_ID_FORMAT = DOMAIN + ".{}"
ENTITY_ID_FORMAT = SENSOR_DOMAIN + "." + DOMAIN + "_{}"


async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
Expand Down
20 changes: 10 additions & 10 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

# Pre-commit requirements
bandit==1.7.0
black==20.8b1
black==21.5b1
codespell==2.0.0
flake8-docstrings==1.5.0
flake8==3.8.4
isort==5.5.3
pydocstyle==5.1.1
pyupgrade==2.7.2
yamllint==1.24.2
flake8-docstrings==1.6.0
flake8==3.9.2
isort==5.8.0
pydocstyle==6.0.0
pyupgrade==2.16.0
yamllint==1.26.1


# Unit tests requirements
pre-commit==2.10.1
pylint==2.6.0
pytest==6.2.2
pre-commit==2.12.1
pylint==2.8.2
pytest==6.2.4
pytest-cov==2.10.1
pytest-homeassistant-custom-component

0 comments on commit c4246b2

Please sign in to comment.