Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config flow, service info & translations #96

Merged
merged 59 commits into from
Dec 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
12b6dd5
Config flow initial implementation
pnbruckner Nov 7, 2023
e08a0c1
black
pnbruckner Nov 7, 2023
9139fed
Incremental checkin
pnbruckner Nov 8, 2023
134ee7e
Move settings from config data to options
pnbruckner Nov 9, 2023
7552a4b
Add service via _attr_device_info
pnbruckner Nov 9, 2023
c0fa25b
Sort manifest.json
pnbruckner Nov 10, 2023
87c7088
Fix 2023.3 compatibility issue
pnbruckner Nov 10, 2023
c6e5a75
Use has_entity_name, sun2 config name is now location
pnbruckner Nov 11, 2023
75e1d1d
Update config entries per configuration
pnbruckner Nov 11, 2023
eb8fc15
First translation implementation
pnbruckner Nov 11, 2023
2fc9495
Add remaining translations
pnbruckner Nov 11, 2023
ab1d6d1
Simplify config entry updating
pnbruckner Nov 12, 2023
5df731e
Remove simple entity types from sun2 config
pnbruckner Nov 12, 2023
5fe55ed
Add nl.json. Thanks metbril!
pnbruckner Nov 12, 2023
ce13b92
Update info.md
pnbruckner Nov 12, 2023
eac6d41
Update README.md
pnbruckner Nov 12, 2023
9bedd11
Bump version to 3.0.0b0 & point doc to branch
pnbruckner Nov 13, 2023
df1c623
Fix config bug when no sensors listed
pnbruckner Nov 13, 2023
d6ae933
Bump version to 3.0.0b1
pnbruckner Nov 13, 2023
28a6b0c
Fix core config update handling
pnbruckner Nov 13, 2023
643bf3e
Bump version to 3.0.0b2
pnbruckner Nov 13, 2023
927c165
Move processing of HA location config to __init__
pnbruckner Nov 14, 2023
6634116
Fix time_at_elevation when config removed from YAML
pnbruckner Nov 14, 2023
b94f47c
Bump version to 3.0.0b3
pnbruckner Nov 14, 2023
19a355c
Translations require HA 2023.4.0 or newer
pnbruckner Nov 14, 2023
9a3d5b3
Move translation lookup to __init__
pnbruckner Nov 15, 2023
f36bb6d
Move config validation to config.py
pnbruckner Nov 15, 2023
ed7cdef
More translations of default entity names
pnbruckner Nov 15, 2023
28c256e
Bump version to 3.0.0b4
pnbruckner Nov 15, 2023
16c9c29
More translations, including attribute names & states
pnbruckner Nov 16, 2023
e497d26
Add PACKAGE_MERGE_HINT
pnbruckner Nov 16, 2023
e3fa933
Add _unreported_attributes
pnbruckner Nov 16, 2023
29e3c63
Make elevation binary sensor config similar to others
pnbruckner Nov 16, 2023
5234667
Add required unique_id for non-simple entity configs
pnbruckner Nov 17, 2023
d176d55
Better handle core config update
pnbruckner Nov 17, 2023
78fa138
Update README.md
pnbruckner Nov 17, 2023
de8e247
Bump version to 3.0.0b5
pnbruckner Nov 17, 2023
5cab09a
Add reload service
pnbruckner Nov 17, 2023
3fcd761
Update README.md
pnbruckner Nov 18, 2023
1628439
Bump version to 3.0.0b6
pnbruckner Nov 18, 2023
82572d2
Use placeholders in misc translations
pnbruckner Nov 18, 2023
7143890
Bump version to 3.0.0b7
pnbruckner Nov 18, 2023
75d6c5d
Add sun2 integration via UI
pnbruckner Nov 21, 2023
34b775f
Add non-simple sensors via UI
pnbruckner Nov 28, 2023
87aa5f7
Update info.md
pnbruckner Nov 28, 2023
fb9bd2c
Update README.md
pnbruckner Nov 29, 2023
94210d7
Move misc translations to satisfy hassfest
pnbruckner Nov 29, 2023
6dce3d6
Update names of additional entities when language is changed
pnbruckner Dec 1, 2023
1c21156
Update README.md
pnbruckner Dec 1, 2023
4c590f7
Bump version to 3.0.0b9
pnbruckner Dec 1, 2023
3902be5
Miscellaneous improvements
pnbruckner Dec 4, 2023
30ee800
ruff, pylint, black & mypy
pnbruckner Dec 5, 2023
4341508
Fix bug with use of abstractmethod & property decorators.
pnbruckner Dec 6, 2023
2980839
Fix bug in hours_to_hms introduced in previous commit
pnbruckner Dec 7, 2023
5a4323f
Use only new style selectors
pnbruckner Dec 8, 2023
ff14d49
Simplify unique IDs for UI added additional sensors
pnbruckner Dec 8, 2023
a30b1be
Add option to remove additional entities
pnbruckner Dec 9, 2023
11ab5c2
Bump version to 3.0.0b10
pnbruckner Dec 9, 2023
b0cd85b
Fix _unrecorded_attributes
pnbruckner Dec 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add _unreported_attributes
  • Loading branch information
pnbruckner committed Nov 16, 2023
commit e3fa93358634150196f741aee99ed6cb5aec556d
22 changes: 21 additions & 1 deletion custom_components/sun2/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,17 @@
from homeassistant.helpers.typing import ConfigType
from homeassistant.util import dt as dt_util

from .const import DOMAIN, ONE_DAY, SIG_HA_LOC_UPDATED
from .const import (
ATTR_NEXT_CHANGE,
ATTR_TODAY_HMS,
ATTR_TOMORROW,
ATTR_TOMORROW_HMS,
ATTR_YESTERDAY,
ATTR_YESTERDAY_HMS,
DOMAIN,
ONE_DAY,
SIG_HA_LOC_UPDATED,
)


Num = Union[float, int]
Expand Down Expand Up @@ -117,6 +127,16 @@ def next_midnight(dttm: datetime) -> datetime:
class Sun2Entity(Entity):
"""Sun2 Entity."""

_unreported_attributes = frozenset(
{
ATTR_NEXT_CHANGE,
ATTR_TODAY_HMS,
ATTR_TOMORROW,
ATTR_TOMORROW_HMS,
ATTR_YESTERDAY,
ATTR_YESTERDAY_HMS,
}
)
_attr_should_poll = False
_loc_data: LocData = None # type: ignore[assignment]
_unsub_update: CALLBACK_TYPE | None = None
Expand Down
Loading