File tree 4 files changed +6
-5
lines changed
4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export class HelperFunctions {
29
29
return nothing
30
30
}
31
31
32
- let moon_phase_localized : unknown = i18n . localize ( `component.entity.sensor.phase.state.${ phase . state } ` )
32
+ let moon_phase_localized : unknown = i18n . localize ( `component.moon. entity.sensor.phase.state.${ phase . state } ` )
33
33
if ( ! moon_phase_localized ) {
34
34
moon_phase_localized = html `< span title ="Install Moon integration to get localized Moon phase name "> ${ phase . state } (!)</ span > `
35
35
}
Original file line number Diff line number Diff line change 1
1
import { NumberFormat , TimeFormat } from 'custom-card-helpers'
2
2
3
3
import { HorizonCardFooter } from '../../../../src/components/horizonCard'
4
+ import { Constants } from '../../../../src/constants'
4
5
import { IHorizonCardConfig , THorizonCardData } from '../../../../src/types'
5
6
import { I18N } from '../../../../src/utils/I18N'
6
7
import { TemplateResultTestHelper } from '../../../helpers/TestHelpers'
@@ -61,7 +62,7 @@ describe('HorizonCardFooter', () => {
61
62
if ( field . startsWith ( 'moon_' ) ) {
62
63
const name = field . substring ( 'moon_' . length )
63
64
if ( name === 'phase' ) {
64
- data . moonData [ name ] = 'full_moon'
65
+ data . moonData [ name ] = Constants . MOON_PHASES . fullMoon
65
66
data . moonData [ 'phaseRotation' ] = 0
66
67
} else {
67
68
data . moonData [ name ] = 0
Original file line number Diff line number Diff line change @@ -192,11 +192,11 @@ exports[`HorizonCardFooter render should render the moon_phase field when it is
192
192
<div class = " horizon-card-field-moon-phase"
193
193
style = " transform: rotate(0deg)"
194
194
>
195
- <ha-icon icon = " mdi:" >
195
+ <ha-icon icon = " mdi:moon-full " >
196
196
</ha-icon >
197
197
</div >
198
198
<div class = " horizon-card-field-value horizon-card-field-value-moon-phase" >
199
- component.sensor.state.moon__phase.undefined
199
+ component.moon.entity. sensor.phase. state.full_moon
200
200
</div >
201
201
</div >
202
202
</div >
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ exports[`HelperFunctions renderFieldElement returns a field element template whe
25
25
</ha-icon >
26
26
</div >
27
27
<div class = " horizon-card-field-value horizon-card-field-value-moon-phase" >
28
- component.sensor.state.moon__phase .full_moon
28
+ component.moon.entity. sensor.phase.state .full_moon
29
29
</div >
30
30
</div >
31
31
` ;
You can’t perform that action at this time.
0 commit comments