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

refactor: remove custom card helpers #540

Merged
merged 29 commits into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e79be8f
refactor: add HomeAssistant type
piitaya Jun 2, 2022
b74e181
refactor: use local HomeAssistant type
piitaya Jun 2, 2022
27b425b
refactor: add computeRTL
piitaya Jun 2, 2022
8344081
chore: remove custom card helpers
piitaya Jun 2, 2022
bbc205c
chore: add handle actions
piitaya Jun 2, 2022
c8a353b
chore: move some helper to ha folder
piitaya Jun 3, 2022
93cfdd5
chore: move action directive to ha folder
piitaya Jun 3, 2022
ff50029
chore: move action struct to ha folder
piitaya Jun 3, 2022
5d4e179
chore: move validate condition to ha folder
piitaya Jun 3, 2022
b39fdea
chore: move some function to ha folder
piitaya Jun 3, 2022
d5882dd
refactor: add export index
piitaya Jun 3, 2022
2811930
chore: migrate alarm card
piitaya Jun 3, 2022
55b2e37
chore: migrate chips card
piitaya Jun 4, 2022
04bcc1a
chore: migrate cover card
piitaya Jun 4, 2022
c00080b
chore: migrate entity card
piitaya Jun 4, 2022
d38df24
chore: migrate fan card
piitaya Jun 4, 2022
4ee513b
chore: migrate humidifier card
piitaya Jun 4, 2022
b4c5c09
chore: migrate light card
piitaya Jun 4, 2022
bee24e9
chore: migrate lock card
piitaya Jun 4, 2022
2b06ee1
chore: migrate media-player card
piitaya Jun 4, 2022
049343e
chore: migrate person card
piitaya Jun 4, 2022
b4fb310
chore: migrate template card
piitaya Jun 4, 2022
fe94058
chore: migrate title card
piitaya Jun 4, 2022
825c61c
chore: migrate update card
piitaya Jun 4, 2022
9afc996
chore: migrate vacuum card
piitaya Jun 4, 2022
9b9ebec
chore: migrate shared folder
piitaya Jun 4, 2022
1b3bf05
chore: migrate utils folder
piitaya Jun 4, 2022
47c6c99
chore: migrate some functions
piitaya Jun 4, 2022
8e30759
fix: remove custom element definition
piitaya Jun 4, 2022
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
188 changes: 7 additions & 181 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@material/mwc-select": "^0.25.3",
"@material/mwc-textfield": "^0.25.3",
"color": "^4.2.3",
"custom-card-helpers": "^1.9.0",
"hammerjs": "^2.0.8",
"home-assistant-js-websocket": "^7.0.3",
"lit": "^2.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LovelaceCardConfig } from "custom-card-helpers";
import { array, assign, boolean, object, optional } from "superstruct";
import { actionsSharedConfigStruct, ActionsSharedConfig } from "../../shared/config/actions-config";
import { layoutSharedConfigStruct, LayoutSharedConfig } from "../../shared/config/layout-config";
import { entitySharedConfigStruct, EntitySharedConfig } from "../../shared/config/entity-config";
import { LovelaceCardConfig } from "../../ha";
import { ActionsSharedConfig, actionsSharedConfigStruct } from "../../shared/config/actions-config";
import { EntitySharedConfig, entitySharedConfigStruct } from "../../shared/config/entity-config";
import { LayoutSharedConfig, layoutSharedConfigStruct } from "../../shared/config/layout-config";
import { lovelaceCardConfigStruct } from "../../shared/config/lovelace-card-config";

export type AlarmControlPanelCardConfig = LovelaceCardConfig &
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fireEvent, LocalizeFunc, LovelaceCardEditor } from "custom-card-helpers";
import { html, TemplateResult } from "lit";
import { customElement, state } from "lit/decorators.js";
import memoizeOne from "memoize-one";
import { assert } from "superstruct";
import { fireEvent, LocalizeFunc, LovelaceCardEditor } from "../../ha";
import setupCustomlocalize from "../../localize";
import { MushroomBaseElement } from "../../utils/base-element";
import { Action } from "../../utils/form/custom/ha-selector-mushroom-action";
Expand Down
16 changes: 8 additions & 8 deletions src/cards/alarm-control-panel-card/alarm-control-panel-card.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { css, CSSResultGroup, html, PropertyValues, TemplateResult } from "lit";
import { customElement, query, state } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { styleMap } from "lit/directives/style-map.js";
import {
actionHandler,
ActionHandlerEvent,
computeRTL,
computeStateDisplay,
handleAction,
hasAction,
HomeAssistant,
isAvailable,
LovelaceCard,
LovelaceCardEditor,
} from "custom-card-helpers";
import { css, CSSResultGroup, html, PropertyValues, TemplateResult } from "lit";
import { customElement, query, state } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { styleMap } from "lit/directives/style-map.js";
import { computeStateDisplay } from "../../ha/common/entity/compute-state-display";
import { isAvailable } from "../../ha/data/entity";
} from "../../ha";
import "../../shared/badge-icon";
import "../../shared/button";
import "../../shared/button-group";
Expand All @@ -23,7 +24,6 @@ import "../../shared/state-item";
import { MushroomBaseElement } from "../../utils/base-element";
import { cardStyle } from "../../utils/card-styles";
import { registerCustomCard } from "../../utils/custom-cards";
import { actionHandler } from "../../utils/directives/action-handler-directive";
import { alarmPanelIconAction } from "../../utils/icons/alarm-panel-icon";
import { stateIcon } from "../../utils/icons/state-icon";
import { getLayoutFromConfig } from "../../utils/layout";
Expand Down
2 changes: 1 addition & 1 deletion src/cards/alarm-control-panel-card/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HassEntity } from "home-assistant-js-websocket";
import { UNAVAILABLE } from "../../ha/data/entity";
import { UNAVAILABLE } from "../../ha";
import {
ALARM_CONTROL_PANEL_CARD_DEFAULT_STATE_COLOR,
ALARM_CONTROL_PANEL_CARD_STATE_COLOR,
Expand Down
9 changes: 4 additions & 5 deletions src/cards/chips-card/chips-card-chips-editor.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { fireEvent, HomeAssistant } from "custom-card-helpers";
import { css, CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from "lit";
import { css, CSSResultGroup, html, PropertyValues, TemplateResult } from "lit";
import { customElement, property, state } from "lit/decorators.js";
import { guard } from "lit/directives/guard.js";
import type { SortableEvent } from "sortablejs";
import { fireEvent, sortableStyles } from "../../ha";
import setupCustomlocalize from "../../localize";
import "../../shared/form/mushroom-select";
import { MushroomBaseElement } from "../../utils/base-element";
import { getChipElementClass } from "../../utils/lovelace/chip-element-editor";
import { CHIP_LIST, LovelaceChipConfig } from "../../utils/lovelace/chip/types";
import { EditorTarget } from "../../utils/lovelace/editor/types";
import { sortableStyles } from "../../utils/sortable-styles";
import "../../shared/form/mushroom-select";
import { MushroomBaseElement } from "../../utils/base-element";

let Sortable;

Expand Down
Loading