Skip to content

Commit

Permalink
Minor cleanup of monitored conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
claha committed May 6, 2019
1 parent 753a3be commit 4cd122f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ The following attributes are tracked by default
* name

Full list of available attributes.
* brokerTradeSummary
* change
* changePercent
* country
Expand Down Expand Up @@ -149,14 +148,16 @@ sensor:
Note: This automation could be further improved by looping over all sensors and checking if their entity_id starts with `sensor.avanza_stock_` and then extract the information.

## Changelog
* 0.0.8 - Ignore dividend if amount is zero, add resources.json and manfiest.json
* 0.0.7 - Changed to async setup
* 0.0.6 - Make sure dividend payment date has not passed
* 0.0.5 - Add dividends information
* 0.0.4 - Add companny information (description, marketCapital, sector, totalNumberOfShares)
* 0.0.3 - Add key ratios (directYield, priceEarningsRatio, volatility)
* 0.0.2 - Configure monitored conditions
* 0.0.1 - Initial version
* 0.0.10 - Clean up monitored conditions
* 0.0.9 - Compare payment date with todays date, ignore time
* 0.0.8 - Ignore dividend if amount is zero, add resources.json and manfiest.json
* 0.0.7 - Changed to async setup
* 0.0.6 - Make sure dividend payment date has not passed
* 0.0.5 - Add dividends information
* 0.0.4 - Add companny information (description, marketCapital, sector, totalNumberOfShares)
* 0.0.3 - Add key ratios (directYield, priceEarningsRatio, volatility)
* 0.0.2 - Configure monitored conditions
* 0.0.1 - Initial version

[buymecoffee]: https://www.buymeacoffee.com/claha
[buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge
Expand Down
16 changes: 6 additions & 10 deletions custom_components/avanza_stock/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
Support for getting stock data from avanza.se.
For more details about this platform, please refer to the documentation at
https://github.com/claha/sensor.avanza_stock/blob/master/README.md
https://github.com/custom-components/sensor.avanza_stock/blob/master/README.md
"""
import logging
from datetime import (
timedelta, datetime)
from datetime import datetime, timedelta

import homeassistant.helpers.config_validation as cv
import requests
import voluptuous as vol

import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_NAME, CONF_MONITORED_CONDITIONS)
from homeassistant.const import CONF_MONITORED_CONDITIONS, CONF_NAME
from homeassistant.helpers.entity import Entity

__version__ = '0.0.9'
__version__ = '0.0.10'

_LOGGER = logging.getLogger(__name__)

Expand All @@ -27,7 +26,6 @@
SCAN_INTERVAL = timedelta(minutes=60)

MONITORED_CONDITIONS = [
'brokerTradeSummary',
'change',
'changePercent',
'country',
Expand All @@ -40,7 +38,6 @@
'isin',
'lastPrice',
'lastPriceUpdated',
# 'latestTrades',
'loanFactor',
'lowestPrice',
'marketList',
Expand All @@ -50,7 +47,6 @@
'morningStarFactSheetUrl',
'name',
'numberOfOwners',
# 'orderDepthLevels',
'orderDepthReceivedTime',
'priceAtStartOfYear',
'priceFiveYearsAgo',
Expand Down

0 comments on commit 4cd122f

Please sign in to comment.