Skip to content

Commit

Permalink
docs: update README for clarity and add screenshot; refactor badge ge…
Browse files Browse the repository at this point in the history
…neration methods for improved readability
  • Loading branch information
SmolSoftBoi committed Jan 7, 2025
1 parent bdfdd32 commit 24edb93
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 12 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Orchard UI

Orchard UI provides a set of custom strategies for Home Assistant dashboards. It supports variews views, include home, floors, rooms, automations, lighting, and more, defined in the `strategies` folder.
Orchard UI provides a set of custom strategies for Home Assistant dashboards. It supports various views, including home, floors, rooms, automations, lighting, and more, defined in the `strategies` folder.

![Orchard UI Home ScreenshotI](./public/screenshot-home.png)
Binary file added public/screenshot-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
],
output: {
sourceMap: {
js: 'inline-cheap-source-map'
js: 'inline-cheap-source-map',
},
},
});
4 changes: 1 addition & 3 deletions src/strategies/badges/energy-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { Entity } from '@smolpack/hasskit';
import { LovelaceBadgeConfig } from '../../lovelace';

export class EnergyBadgeStrategy {
static async generate(
c02SignalEntity: Entity
): Promise<LovelaceBadgeConfig> {
static async generate(c02SignalEntity: Entity): Promise<LovelaceBadgeConfig> {
return {
type: 'entity',
entity: c02SignalEntity.uniqueIdentifier,
Expand Down
4 changes: 3 additions & 1 deletion src/strategies/badges/lights-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { LightEntity } from '@smolpack/hasskit';
import { LovelaceBadgeConfig } from '../../lovelace';

export class LightsBadgeStrategy {
static async generate(lightEntity: LightEntity): Promise<LovelaceBadgeConfig> {
static async generate(
lightEntity: LightEntity
): Promise<LovelaceBadgeConfig> {
return {
type: 'entity',
entity: lightEntity.uniqueIdentifier,
Expand Down
4 changes: 3 additions & 1 deletion src/strategies/badges/speakers-tvs-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Entity } from '@smolpack/hasskit';
import { LovelaceBadgeConfig } from '../../lovelace';

export class SpeakersTvsBadgeStrategy {
static async generate(mediaPlayerEntity: Entity): Promise<LovelaceBadgeConfig> {
static async generate(
mediaPlayerEntity: Entity
): Promise<LovelaceBadgeConfig> {
return {
type: 'entity',
entity: mediaPlayerEntity.uniqueIdentifier,
Expand Down
10 changes: 7 additions & 3 deletions src/strategies/cards/climate-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { ClimateEntity } from '@smolpack/hasskit';
import { LovelaceCardConfig } from '../../lovelace';

export class ClimateCardStategy {
static async generate(climateEntity: ClimateEntity): Promise<LovelaceCardConfig> {
static async generate(
climateEntity: ClimateEntity
): Promise<LovelaceCardConfig> {
return {
type: 'tile',
entity: climateEntity.uniqueIdentifier,
Expand All @@ -12,7 +14,9 @@ export class ClimateCardStategy {
};
}

static async generateFeatures(climateEntity: ClimateEntity): Promise<object[]> {
static async generateFeatures(
climateEntity: ClimateEntity
): Promise<object[]> {
const features: object[] = [
{
type: 'climate-hvac-modes',
Expand All @@ -30,7 +34,7 @@ export class ClimateCardStategy {

features.push({
type: 'target-temperature',
})
});

return features;
}
Expand Down
4 changes: 3 additions & 1 deletion src/strategies/sections/floor-section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export class FloorSectionStrategy {
const promises = [FloorHeadingCardStrategy.generate(floor)];

for (const area of floor.areas) {
for (const climateService of area.entitiesWithDomains(['climate']) as ClimateEntity[]) {
for (const climateService of area.entitiesWithDomains([
'climate',
]) as ClimateEntity[]) {
promises.push(ClimateCardStategy.generate(climateService));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/strategies/views/home-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class HomeViewStrategy extends ReactiveElement {
}

if (home.c02SignalEntity) {
promises.push(EnergyBadgeStrategy.generate(home.c02SignalEntity))
promises.push(EnergyBadgeStrategy.generate(home.c02SignalEntity));
}

if (home.wasteEntity) {
Expand Down

0 comments on commit 24edb93

Please sign in to comment.