-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Multi Lingal, Alarm Card and much, much more.... #149
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shannonhochkins
changed the title
Feature/135 multilingal
Multi Lingal, Alarm Card and much, much more....
Jun 21, 2024
gmartenscb
reviewed
Jun 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shannonhochkins
added a commit
that referenced
this pull request
Jun 22, 2024
* Add alpha values to hsl colors (#141) * Allow entity modal to accept additional children (#144) * Allow entity modal to accept additional children for customization thru composition * PR feedback to fix typing * Ensure hover style not retained if focus is removed (#142) * Add alarm control panel buttons (#145) * Add alarm control panel buttons * Update comment * Multi Lingal, Alarm Card and much, much more.... (#149) * Lots of updates, will describe in pr * removing npm module and using different local function for "time ago" readings * Updating more shit * Utilities for computeAttributeDisplay * TimeCard updated to handle with / without entities * More cleanup! * Updating docs and styles * theme provider and modal changes (#155) --------- Co-authored-by: kdkavanagh <kdkavanagh@gmail.com>
wij hebben op de computer ge instaleerd en moet nu nog ook ingeld maar wik komen niet verder |
English please! :) I have no idea what you're saying 😁 translator says you can't get past a certain point, you're going to need to provide more context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
4.0.0
@hakit/components
features
added to the code when adefaultCode
is present. issuelocalize
method from@hakit/core
which will display previously hard coded values in english, as well as much more in the language of your choice, this can be configured by simply changing the language in your home assistant instance, or by providing it to HassConnect. As values may change in your language of choice, the layouts may also change to what you're expecting - please report any issues. issue-ha-info-color
and other success/warning/error colors, this is also a breaking change as the variables were renamed slightly issuefeatures
prop that acceptsFeatureEntity
orFeatureEntity[]
as a type to render actions as part of the "footer" of the card, this has already been introduced into the ClimateCard, AlarmCard & CameraCard, this is similar in terms of functionality to what Home Assistant provided for its "features"relatedEntities
prop that acceptsReleatedEntity
orReleatedEntity[]
that has pre-calculated zones for position which will just overlay ontop of the card container, ie if the position prop is set toright top
it will position the element in the right top most part of the container, the AlarmCard demo shows this through the use of the the battery icon, useful to display the battery level of an entity in a separate entity card.graph
prop which will allow you to show a graph like the "SensorCard" does by adding thegraph
to the bottom of the card, you can also control how the graph displays it's history, styles, position and more.resizeDetectorProps
- allows you to tap into the resizer to retrieve the size of the card in pixels from a callback for either width, height or both at once and more, this is currently throttled by 50ms, this is useful if your card needs to know it's own sizesensor.time
andsensor.date
as entities, by default it will still use these, but now you can also just use the system clock of the browser running the instance, which opens up additional functionality to format the date/time values with a simple format string with thedateFormat
andtimeFormat
props and also a custom formatting option as a callback for both date and time too. You can also control how often the update occurs by changing thethrottleTime
prop (defaults to 1000ms), also,iconProps
was introduced here too.Fab
of the button card is now the animated vacuum image.iconProps
added, internally, performance update made to use the global resize detectoriconProps
andsliderIconProps
added to style the icons independentlyfabProps
added to style the wrapping element of the icon within the card, this allows you to change the background color amongst other things for the Fab element.unitOfMeasurement
prop added to allow users the ability to change the displayed unit of measurement on entities.customRenderState
- new prop added as a function to allow you to render the state within the card however you like, by default it will just render the state of the entity.hideToggle
prop added to hide the toggle button in the default layout type.hideIcon
- new prop to ide the iconiconProps
to provide additional styles to the icon.showHvacModeLabels
- add this prob to display the locale label of the mode in the feature buttons - note this may only be useful if you're displaying one or two hvac modes.locateNode
prop, the text/node to render when locating @default 'Locate...' in preferred language, addedbuttonGroupProps
to adjust how the buttons are displayed.layoutType
prop which now supports "bubble" and "grouped", grouped is the default and is what it was previously, bubble is what's used by the "features" within the cards. ButtonBar also supports new props to change the alignment within, like gap, and flex properties.gap
property to adjust the spacing between the children, newmaintainAspectRatio
prop which is enabled by default to maintain the 1/1 ratio of the buttons.disabled
,iconProps
anddisableScaleEffect
also now introduced.hideActiveBorder
- when in bubble layoutType you can hide the bottom border of the button.iconProps
addedhvacModeLabels
to customize the hvac mode labels from the default, this can be passed down from the ClimateCard through themodalProps
prop.showTemperatureControls
propdefaultLayout
prop renamed tolayoutType
, to fix this, simply find and replacedefaultLayout
and replace withlayoutType
.iconColor
renamed toiconProps
to expose more functionality to the user to re-style the icon element.Previously, you'd provide an
iconColor
prop with a string which was available on all cards, below is an example of how to convert this to the newiconProps
prop:BREAKING - ButtonCard - swapped title and description on ButtonCard, it's always bothered me that the title is actually the "second" element on the button, this has been changed, to fix this if you're using either the description or the title prop or both, simply invert the names. Fixes issue
@hakit/core
useTranslations
hook has also been removed.useLocale
,useLocales
- a hook to retrieve the locales, useLocale is similar in nature to thelocale
function, useLocales will return all available locales from home assistant.fetchTranslations
and replaced with multilingual support, this was previously used to fetch translations from home assistant, now this is done automatically through thelocalize
method.useTranslations
as this is now handled with thelocalize
method.hassToken
property which will allow you to bypass the login screen fixesportalRoot
property, AreaCard, Tooltip, Modal - now have the ability to change the portal root, meaning if you're rendering within an iframe, you can change the root of the portal to render these elements in the correct location. This is configurable from HassConnect through theportalRoot
option.useDevice
a hook to retrieve extended information about a device from home assistant. issuecomputeAttributeDisplay
a method that will format the attribute value based on the entity you're accessing it from, it will suffix it with expected units, or format dates/numbers automatically for you.computeAttributeDisplay
a function that will convert a domain name into a localized titlecomputeStateDisplay
- a function that will format the values of the state depending on the entity attributes and entity type.formatDate
,formatTime
,formatDateTime
- helper functions to convert a time value based on the config of the home assistant instance.timeAgo
- exposingtimeAgo
function that displays the relative time from now from a date string, ie 8 hours ago, 2 days ago etc.create-hakit
hassToken
option as a default and will prompt you to enter the token if you don't provide it.Storybook