* add formatEntityStateToParts
* add formatEntityStateToParts
* use formatEntityStateToParts
* add formatEntityStateToParts
* use formatEntityStateToParts
* add formatEntityStateToParts
* add formatEntityStateToParts
* add computeStateDisplayToParts
* update for monetary
* fix a test for monetary
* fixed test for monetary
* do not include "order" into result
* do not include "order" into result
* do not include "order" into result
* do not include "order" into result
* do not include "order" into result
* do not include "order" into result
* do not include "order" into result
* simplify
* ensure less conflicts in future merges
* Refactor monetary computing
---------
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
* Migrate profile dialog(s) to wa
* Make sure code is entered before submit is allowed
* Refactor dialog
* Remove unused params
* Pass existing names and validate name is not already used
* Reduce cleanup on show
* Make QR image larger
* max width
* Fix
* Remove extra event fire
* Make params required
* cleanup
* Cleanup
* Fix
* Fix
* Update @home-assistant/webawesome to version 3.2.1 and refactor ha-dropdown integration in automation picker
* review
* revert wa update
* Update @home-assistant/webawesome to version 3.0.0-ha.2 in yarn.lock
* Add splitNumber option to monthly ECharts
When there are a small number of bars (<=3) for monthly data, set the splitNumber parameter to force the date x-axis to show whole months.
* Add axis tick fomratting for short months
This ensures that the month format is consistent between 2/3 month and longer ranges.
* Avoid calling getSuggestedMax twice
* Fix another case of power chart cutting off last hour of data
The previous fix only solved the problem for 5-minute data, not hourly or daily. This should solve the issue regardless, and allows the energy chart to have other line-based plots in the future.
* Update other uses of getSuggestedMax()
* Fix statistics-chart Last Period Rendering
1. When appending the "current state" value, if the current time intersects with the final period, we can end up with the chart folding back on itself. This is fixed by ensuring for the final period we push the earlier of the statistic end time and the display end time (which is in turn limited to now).
2. Always close off the last data point at the chart end time. Otherwise for line charts, the final period doesn't get rendered.
* Remove unused monthStyle formatter.
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
* Rename getSuggestedMax function parameter in energy chart
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
* Document magic numbers in montly energy chart
* Make padding a constant for clarity.
* Explain the purpose of splitNumber.
---------
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
When HistoryStream.processMessage() prunes expired history and preserves
the last expired state as a boundary marker, it updates lu (last_updated)
but not lc (last_changed). Chart components use lc preferentially, so
when lc is present the boundary point gets plotted at the original stale
timestamp far to the left of the visible window. Delete lc from the
boundary state so the chart uses the corrected lu timestamp.
* fix padding & margin
* fix margin for icon
* fix margin for icon
* fix margin for image
* use ha-space-4
* use --ha-space-4
* use ha-space-1
* use ha-space-4
* fix styles
* fix a gap between logos
* fix a gap between logos
* fix right margin for logo
* fix right margin for logo
* show icons in flex
* remove unneeded style
* add right margin for logo
* Fix Discord link for designers
Updated Discord link for designers to the correct channel.
* Update Discord link for designers in home.markdown
* Update gallery/src/pages/concepts/home.markdown
Co-authored-by: Aidan Timson <aidan@timmo.dev>
---------
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Aidan Timson <aidan@timmo.dev>
* Use Suggested Period for Energy Tooltip
Ensure the tooltips for energy charts match energy data grouping by using getSuggestedPeriod rather than hardcoded differenceInDays.
* Make getSuggestedMax return Date()
Currently used in two places - for energy charge ECOption, and for a statistics-graph. In both places a Date is expected rather than a Number. No point converting to a Number with getTime() when they are immediately converted back to a Date.
* Add support for context in quick bar
* Send context from device page
* Use interface
* Prefetch and pass related result to dialog instead of loading on show (load on event call)
* Apply suggestion from @MindFreeze
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
* Add error
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
* Fix
---------
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
* Allow HaDropdownSelectEvent to pass the value type
* Fix potential type conflict
* Add clarification of type
* Fix type
* Create new type for ha-select
* Refactor
* Add clearable to only handle undefined when needed
* Value changed event
* Use clearable type
* Remove
* Profile section refactor
* Protocols refactor
* More config refactor
* Entity rows 1
* Remove unrelated
* Remove ValueChangedEvent changes (moved to separate branch)
* Revert
* Add
* Revert unrelated or extra checks
* Restore
* Restore
* Restore
* Update src/components/ha-conversation-agent-picker.ts
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
---------
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
* Show Year on Energy Dashboard Date Picker
When the selected range (start and/or end) is in a different year from the current one, show the year for that date.
* Correct Energy Picker Year Detection
Ensure that when checking if a range is a full year, the endpoints must be in the same calendar year.
Otherwise selecting a 12-month range that spans into two years would be treated as all being a single year.
* Add natural wrapping spans for date range
Encourage the range to wrap nicely if the text is too large for the toolbar.
* Use en dash between date range
The en dash character is usually used for date ranges rather than the
standard hypen
* Fix Now Button Rendering on Resize
Host element needs to be `display:block` no the default `display:inline` for the ResizeObserver to work.
* Remove P tag from date picker range label
Removing the paragraph tag and adding text-align center seems to produce cleaner wrapping of the date range on narrower screens.
* Allow Overriding HA Dialog Header Font Size
For the title and subtitle, variables can not be set in the host to control the font size. This is useful in cases where the heading is used on a narrow card and the title needs to be smaller.
* Add property to manually trigger opening of ha-date-range-picker
For cases where there is a desire to click in regions other than the calendar icon to have the date picker open.
* Add no-padding option to ha-dialog-header
When used within cards already containing padding, the extra padding may be unnecessary.
* Use ha-dialog-header for Energy Period Selector
Place the day/month in the title and the year in the subtitle. This gives a cleaner more consistent look.
* Remove Unnecessary IDs
Came from copy-paste from another example.
* Apply Typing to Date Picker Methods
* Move selector buttons to overflow if too small
When the period selector gets too small to fit everything (very narrow screens, or card in grid), then move the next/previous buttons to the overflow menu.
The now button exists on the overflow menu now too when in narrow mode.
* Change Date Picker openPicker to open()
Makes far more sense as a method not a property.
* Revert Padding Change to ha-dialog-header
* Simplify Energy Selector Overflow Buttons
Improve button labelling to just use index, avoiding possible localisation issues of using the label.
Simplify the interface to remove unnecessary fields.
* Update Button Collapse Width for Picker
Increase to 300px now that padding of dialog header is present.
* Fix Imports in Energy Period Selector
* Fix whitespace
* Properly leverage slots in ha-dialog-header
Make proper use of the actionItems slot for the control buttons to keep them properly contained as the date selector is resized.
* Move clickable date to title/subtitle elements
In moving the control buttons into the actionItems slot, we can no longer use the whole ha-dialog-header element as a clickable region for opening the date selector. Frankly this is not a bad thing as it meant it was not possible to nicely hover/highlight the date.
Instead we now make the title/subtitle clickable elements. This allows adding a nice hover effect and cursor pointer effect.
* Add option to make ha-dialog-header content clickable
* Use clickable dialog header in period selector
This way the whole title area is the hit point rather than the title and subtitle text individually.
* Remove ha-dialog-header from period selector
It's not a dialog, so it makes no sense to use that element. Instead recreate just the necessary parts to make it stylistically simiar. The reality is this is not much extra code, and it should make maintaining easier.
* Revert changes to ha-dialog-header
* Style Date Range as Input Field
* Use ha-ripple Effect
* Remove Unnecessary Tooltip Option
Unused, so remove the extra complexity.
* Remove more unused imports
* Force energy panel picker open direction
Now that the button is on the left, we need it to open to the right to avoid colision with the sidebar. Add the option to force the direction.
* Rename property to openingDirection for consistency